Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,25 +170,31 @@ npm run test:integration

This mode leverages the `--mode test` and `--mode-test-url` flags to redirect resource lookups to a fixture server instead of live or local resources.

## Maintenance: Node.js engine bumps
## Maintenance

### Node.js engine bumps

The `Node.js` engine requirements are updated on a predictable biannual schedule to ensure the server remains secure, leverages modern runtime features, and provides stability for consumers.

> Our engine requirements are intended to be the minimum to run the MCP server. They are not intended to be a maximum, as newer versions may introduce breaking changes or require additional configuration.

### Schedule and process
#### Schedule and process
- **Timing**: Bumps are generally targeted for **Spring (April/May)** and **Fall (October/November)**, aligned with the [Node.js release schedule](https://nodejs.org/en/about/previous-releases) as versions enter or exit LTS.
- **Security**: Out-of-band updates may be performed if critical security considerations arise.
- **Version Targets**:
- Focus on the latest **even-numbered (LTS/Stable)** versions (e.g., bumping to 22, 24, or 26).
- GitHub Workflows should be updated to include the latest available even version.

### Acceptance criteria for bumps
#### Acceptance criteria for bumps
- Update `package.json` engine requirements.
- Update related GitHub Action workflows (CI/CD).
- Update "Environmental Requirements" in documentation.
- Ensure all tests pass on the new target version.

### Project maintenance

For information on project development maintenance tasks, refer to [Project development maintenance in docs/development.md](./docs/development.md#project-development-maintenance).

## AI agent

### User section
Expand Down
19 changes: 16 additions & 3 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Complete guide to using the PatternFly MCP Server for development including CLI
- [Experimental settings](./experimental.md)
- [MCP tool plugins](#mcp-tool-plugins)
- [Initial troubleshooting](#initial-troubleshooting)
- [Project maintenance](#project-maintenance)
- [Project development maintenance](#project-development-maintenance)
- [In-progress and future work](#in-progress-and-future-work)

## CLI usage
Expand Down Expand Up @@ -446,9 +446,22 @@ These terms describe **how tools and their related properties are represented**
- **Missing tools/resources**: Verify the server started successfully and check logs with `--log-stderr`.
- **Type errors**: Ensure TypeScript types are installed: `npm install --save-dev @types/node`

## Project maintenance
## Project development maintenance

For information on how we manage project dependencies, including our biannual Node.js engine bump schedule, please refer to the [Maintenance section in CONTRIBUTING.md](../CONTRIBUTING.md#maintenance-nodejs-engine-bumps).
For information on build maintenance, refer to [Maintenance in CONTRIBUTING.md](../CONTRIBUTING.md#nodejs-engine-bumps).

### Updating collections

The server packages pre-built collections (such as `src/collection.patternFlyApi.json`) to provide quick MCP startups.

To refresh and validate the embedded API collection:

```bash
npm run build:collections
```

- **Execution**: Crawls live PatternFly API endpoints, filters quality records, updates `src/collection.patternFlyApi.json`, and executes collection-specific Jest validation tests (`jest --selectProjects collections`).
- **When to run**: When PatternFly publishes new component API releases or when updating metadata/quality filters.

## In-progress and future work

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`collectionCallback should match snapshot for collection result 1`] = `
"records": [
{
"data": {
"card": [
"Card": [
{
"category": "css",
"contentType": "",
Expand Down Expand Up @@ -46,7 +46,7 @@ exports[`getPatternFlyApiRecords should attempt to convert expanded embedded rec
[
{
"data": {
"dolor": [
"Dolor": [
{
"category": "react",
"contentType": "text/markdown",
Expand Down
3 changes: 1 addition & 2 deletions src/__tests__/__snapshots__/options.defaults.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ exports[`options defaults should return specific properties: defaults 1`] = `
"props",
"css",
],
"enabled": false,
"schedule": {
"continueOnError": true,
"delayStartMs": 21600000,
"delayStartMs": 604800000,
"intervalMs": 604800000,
"repeat": Infinity,
},
Expand Down
33 changes: 33 additions & 0 deletions src/__tests__/__snapshots__/server.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ exports[`runServer should allow server to be stopped, http stop server: diagnost
[
"Registered collection: patternfly-component-schemas",
],
[
"Registered collection: patternfly-api",
],
[
"Registered resource: patternfly-context",
],
Expand Down Expand Up @@ -89,6 +92,9 @@ exports[`runServer should allow server to be stopped, stdio stop server: diagnos
[
"Registered collection: patternfly-component-schemas",
],
[
"Registered collection: patternfly-api",
],
[
"Registered resource: patternfly-context",
],
Expand Down Expand Up @@ -157,6 +163,9 @@ exports[`runServer should attempt to run server, create transport, connect, and
[
"Registered collection: patternfly-component-schemas",
],
[
"Registered collection: patternfly-api",
],
[
"Registered resource: patternfly-context",
],
Expand Down Expand Up @@ -236,6 +245,9 @@ exports[`runServer should attempt to run server, disable SIGINT handler: diagnos
[
"Registered collection: patternfly-component-schemas",
],
[
"Registered collection: patternfly-api",
],
[
"Registered resource: patternfly-context",
],
Expand Down Expand Up @@ -310,6 +322,9 @@ exports[`runServer should attempt to run server, enable SIGINT handler explicitl
[
"Registered collection: patternfly-component-schemas",
],
[
"Registered collection: patternfly-api",
],
[
"Registered resource: patternfly-context",
],
Expand Down Expand Up @@ -389,6 +404,9 @@ exports[`runServer should attempt to run server, log warnings for experimental o
[
"Registered collection: patternfly-component-schemas",
],
[
"Registered collection: patternfly-api",
],
[
"Registered resource: patternfly-context",
],
Expand Down Expand Up @@ -483,6 +501,9 @@ exports[`runServer should attempt to run server, register a tool: diagnostics 1`
[
"Registered collection: patternfly-component-schemas",
],
[
"Registered collection: patternfly-api",
],
[
"Registered resource: patternfly-context",
],
Expand Down Expand Up @@ -570,6 +591,9 @@ exports[`runServer should attempt to run server, register multiple tools: diagno
[
"Registered collection: patternfly-component-schemas",
],
[
"Registered collection: patternfly-api",
],
[
"Registered resource: patternfly-context",
],
Expand Down Expand Up @@ -664,6 +688,9 @@ exports[`runServer should attempt to run server, use custom options: diagnostics
[
"Registered collection: patternfly-component-schemas",
],
[
"Registered collection: patternfly-api",
],
[
"Registered resource: patternfly-context",
],
Expand Down Expand Up @@ -743,6 +770,9 @@ exports[`runServer should attempt to run server, use default tools, http: diagno
[
"Registered collection: patternfly-component-schemas",
],
[
"Registered collection: patternfly-api",
],
[
"Registered resource: patternfly-context",
],
Expand Down Expand Up @@ -831,6 +861,9 @@ exports[`runServer should attempt to run server, use default tools, stdio: diagn
[
"Registered collection: patternfly-component-schemas",
],
[
"Registered collection: patternfly-api",
],
[
"Registered resource: patternfly-context",
],
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/collection.patternFlyApi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ describe('collectionCallback', () => {
expect(keys.length).toBe(1);
const key: any = keys[0];

expect(key).toBe('button');
expect(key).toBe('Button');

expect(first).toMatchObject({
sourceId: `${BASE}/v1/components/Button/react`
Expand Down Expand Up @@ -284,7 +284,7 @@ describe('collectionCallback', () => {

const key: any = rec?.data ? Object.keys(rec.data)[0] : '';

expect(key).toBe('card');
expect(key).toBe('Card');
expect(rec?.data?.[key]).toContainEqual(expect.objectContaining({
displayName: 'Card',
category: 'overview'
Expand Down
14 changes: 7 additions & 7 deletions src/__tests__/collection.patternFlyApiHelpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -966,43 +966,43 @@ describe('extractApiName', () => {
description: 'components section returns normalized item name',
item: 'Button',
section: 'components',
expected: 'button'
expected: 'Button'
},
{
description: 'components section with uppercase and whitespace',
item: ' Card ',
section: ' Components ',
expected: 'card'
expected: 'Card'
},
{
description: 'overview item with custom section adds suffix',
item: 'overview',
section: 'utilities',
expected: 'utilities-overview'
expected: 'UtilitiesOverview'
},
{
description: 'item already prefixed with section avoids double prefix',
item: 'charts-pie',
section: 'charts',
expected: 'charts-pie'
expected: 'ChartsPie'
},
{
description: 'item already prefixed with uppercase section name',
item: 'Patterns-Gallery',
section: 'patterns',
expected: 'patterns-gallery'
expected: 'PatternsGallery'
},
{
description: 'non-prefixed item in custom section prefixes section',
item: 'pie',
section: 'charts',
expected: 'charts-pie'
expected: 'ChartsPie'
},
{
description: 'non-prefixed item in patterns section prefixes section',
item: 'gallery',
section: 'patterns',
expected: 'patterns-gallery'
expected: 'PatternsGallery'
}
])('should extract API name, $description', ({ item, section, expected }) => {
expect(extractApiName(item, section)).toBe(expected);
Expand Down
Loading
Loading