-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Use Feature V2 API schemas from updated OpenAPI specification, cleanup tools #512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
devcycle-mcp-server | b7b93c4 | Sep 16 2025, 07:38 PM |
41400a7 to
3f55ddb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces updated API schemas generated from the latest OpenAPI specification while maintaining backward compatibility and cleaning up MCP tools. It updates V2 schemas for selective migration, fixes TypeScript compilation issues, and consolidates feature management functionality by removing specific variation and targeting tools.
- Updates API schemas from latest OpenAPI spec with V2 schemas generated in
zodClientV2.ts - Adds explicit type annotations for TypeScript compatibility and removes redundant MCP tools
- Removes variation and targeting specific MCP tools to rely on the main PATCH feature endpoint
Reviewed Changes
Copilot reviewed 27 out of 30 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/api/zodClient.ts | Updates schema references to use V2 definitions and adds TypeScript workarounds for large schema inference |
| src/api/schemas.ts | Refactors to use direct imports from zodClient instead of schemas object |
| src/mcp/types.ts | Updates MCP tool schema references to use direct imports instead of schemas object |
| src/mcp/tools/featureTools.ts | Comments out variation and targeting specific tools, consolidating to main feature endpoint |
| src/ui/prompts/*.ts | Adds explicit type annotations for map callbacks to improve TypeScript inference |
| src/commands/**/*.ts | Adds type imports and explicit type annotations for better type safety |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 27 out of 30 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 27 out of 30 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| // serverInstance.registerToolWithErrorHandling( | ||
| // 'fetch_feature_variations', | ||
| // { | ||
| // description: [ | ||
| // 'Get a list of variations for a feature.', | ||
| // 'Include dashboard link in the response.', | ||
| // ].join('\n'), | ||
| // annotations: { | ||
| // title: 'Get Feature Variations', | ||
| // readOnlyHint: true, | ||
| // }, | ||
| // inputSchema: ListVariationsArgsSchema.shape, | ||
| // }, | ||
| // async (args: any) => { | ||
| // const validatedArgs = ListVariationsArgsSchema.parse(args) | ||
| // return await fetchFeatureVariationsHandler(validatedArgs, apiClient) | ||
| // }, | ||
| // ) | ||
|
|
||
| // serverInstance.registerToolWithErrorHandling( | ||
| // 'create_feature_variation', | ||
| // { | ||
| // description: [ | ||
| // 'Create a new variation within a feature.', | ||
| // 'Include dashboard link in the response.', | ||
| // ].join('\n'), | ||
| // annotations: { | ||
| // title: 'Create Feature Variation', | ||
| // }, | ||
| // inputSchema: CreateVariationArgsSchema.shape, | ||
| // }, | ||
| // async (args: any) => { | ||
| // const validatedArgs = CreateVariationArgsSchema.parse(args) | ||
| // return await createFeatureVariationHandler(validatedArgs, apiClient) | ||
| // }, | ||
| // ) | ||
|
|
||
| // serverInstance.registerToolWithErrorHandling( | ||
| // 'update_feature_variation', | ||
| // { | ||
| // description: [ | ||
| // 'Update an existing variation by key.', | ||
| // '⚠️ WARNING: Updating a feature variation may affect production environments.', | ||
| // 'Include dashboard link in the response.', | ||
| // ].join('\n'), | ||
| // annotations: { | ||
| // title: 'Update Feature Variation', | ||
| // destructiveHint: true, | ||
| // }, | ||
| // inputSchema: UpdateVariationArgsSchema.shape, | ||
| // }, | ||
| // async (args: any) => { | ||
| // const validatedArgs = UpdateVariationArgsSchema.parse(args) | ||
| // return await updateFeatureVariationHandler(validatedArgs, apiClient) | ||
| // }, | ||
| // ) | ||
|
|
||
| // serverInstance.registerToolWithErrorHandling( | ||
| // 'set_feature_targeting', | ||
| // { | ||
| // description: [ | ||
| // 'Set targeting status for a feature in an environment.', | ||
| // '⚠️ IMPORTANT: Always confirm with the user before making changes to production environments (environments where type = "production").', | ||
| // 'Include dashboard link in the response.', | ||
| // ].join('\n'), | ||
| // annotations: { | ||
| // title: 'Set Feature Targeting', | ||
| // destructiveHint: true, | ||
| // }, | ||
| // inputSchema: SetFeatureTargetingArgsSchema.shape, | ||
| // }, | ||
| // async (args: any) => { | ||
| // const validatedArgs = SetFeatureTargetingArgsSchema.parse(args) | ||
| // return await setFeatureTargetingHandler(validatedArgs, apiClient) | ||
| // }, | ||
| // ) | ||
|
|
||
| // serverInstance.registerToolWithErrorHandling( | ||
| // 'list_feature_targeting', | ||
| // { | ||
| // description: [ | ||
| // 'List feature configurations (targeting rules) for a feature.', | ||
| // 'Include dashboard link in the response.', | ||
| // ].join('\n'), | ||
| // annotations: { | ||
| // title: 'List Feature Targeting Rules', | ||
| // readOnlyHint: true, | ||
| // }, | ||
| // inputSchema: ListFeatureTargetingArgsSchema.shape, | ||
| // }, | ||
| // async (args: any) => { | ||
| // const validatedArgs = ListFeatureTargetingArgsSchema.parse(args) | ||
| // return await listFeatureTargetingHandler(validatedArgs, apiClient) | ||
| // }, | ||
| // ) | ||
|
|
||
| // serverInstance.registerToolWithErrorHandling( | ||
| // 'update_feature_targeting', | ||
| // { | ||
| // description: [ | ||
| // 'Update feature configuration (targeting rules) for a feature in an environment.', | ||
| // '⚠️ IMPORTANT: Always confirm with the user before making changes to production environments (environments where type = "production").', | ||
| // 'Include dashboard link in the response.', | ||
| // ].join('\n'), | ||
| // annotations: { | ||
| // title: 'Update Feature Targeting Rules', | ||
| // destructiveHint: true, | ||
| // }, | ||
| // inputSchema: UpdateFeatureTargetingArgsSchema.shape, | ||
| // }, | ||
| // async (args: any) => { | ||
| // const validatedArgs = UpdateFeatureTargetingArgsSchema.parse(args) | ||
| // return await updateFeatureTargetingHandler(validatedArgs, apiClient) | ||
| // }, | ||
| // ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleanup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keeping them for now as I'm verifying the functionality of these tools, but yea there are a couple of these that I'm going to cleanup at the end of all these branches.
| // summary: UpdateFeatureDto.shape.summary.describe( | ||
| // 'Updated feature summary', | ||
| // ), | ||
| // staleness: UpdateFeatureDto.shape.staleness.describe( | ||
| // 'Updated feature staleness configuration', | ||
| // ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cleanup?
|
@JamieSinn can I get a review on this root PR? |
- Add intermediate type aliases to break complex Zodios endpoint inference chains - Replace 'any' callback parameters with proper TypeScript interfaces (Project, Environment, Variable, etc.) - Add missing FeatureOverride type export to zodClient schemas - Add zod-to-json-schema dependency for schema comparison tools - Maintain full type safety throughout codebase while working around TS inference limits
- Update schemas.ts to import schemas directly instead of from schemas object - Fix zodClient export syntax by using proper alias syntax - Unify Variable and Feature schemas by importing from zodClientV2 - Fix schema compatibility issues between zodClient and zodClientV2 - Update all schema references in commands and MCP types - Add type casting where needed to resolve remaining compatibility issues
- Fix Zodios schema validation errors by updating test fixtures - Add missing required fields (tags, publicName) to mock data - Update HTTP request matching in Nock expectations for features update - Fix MCP server test tool count expectations (21 vs 25+ tools) - Update test snapshots to reflect schema changes - Resolve all 187 test suite failures caused by stricter type validation
a4a94fb to
b7b93c4
Compare
JamieSinn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stacked prs should be merged bottom up. This is just insanely huge now
|
@JamieSinn nothing has been merged into this one, this was the original one before I figured out what I was going to do and started stacking. |
|
Ah - i thought the updates were from merges |
This PR introduces updated API schemas generated from the latest OpenAPI specification while maintaining backward compatibility and resolving TypeScript compilation issues. The new schemas in the
zodClientV2.tsfile are just being used for the/v2/featuresendpoints for now, in further PRs will update the rest of the endpoints. Also removed all theChanges
src/api/zodClientV2.tswith updated Zod schemas from latest OpenAPI specanytypes with proper schema-derived interfaces (Project,Environment,Variable, etc.)variationandtargetingMCP tools, just relying on PATCH feature endpoint.Migration Strategy
V2 schemas are available for selective adoption alongside existing V1 schemas, allowing gradual migration without breaking existing functionality.