feat: gate issue_write and get_issue behind remote_mcp_issue_fields flag#2553
Open
kelsey-myers wants to merge 4 commits into
Open
feat: gate issue_write and get_issue behind remote_mcp_issue_fields flag#2553kelsey-myers wants to merge 4 commits into
kelsey-myers wants to merge 4 commits into
Conversation
- Extend FeatureFlagEnable/Disable fields from string to []string (AND semantics for enable, OR semantics for disable) so a tool can require multiple flags simultaneously. - Add LegacyIssueWrite: the FeatureFlagIssueFields-disabled variant of issue_write. It exposes the pre-issue-fields schema (no issue_fields parameter) and skips the custom field value resolution. Both this and IssueWrite register under the tool name 'issue_write'; exactly one is active at a time via mutually exclusive flag annotations. - Gate IssueWrite (the flag-enabled variant) with FeatureFlagEnable so it is only served when remote_mcp_issue_fields is on. - Gate the get_issue field_values enrichment with a runtime IsFeatureEnabled check so the GraphQL round-trip is skipped when the flag is off. - Add issue_write.snap (legacy) and issue_write_ff_remote_mcp_issue_fields.snap (flag-enabled) toolsnaps following the convention established by PR github#2520. - Modernise featureFlagAllowed disableFlags loop to slices.ContainsFunc.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR gates issue-field-related issue_write schema/behavior and get_issue enrichment behind remote_mcp_issue_fields, while expanding inventory feature flag annotations to support multiple flags.
Changes:
- Converts inventory feature flag annotations from single strings to string slices with AND enable / OR disable semantics.
- Splits
issue_writeinto legacy and issue-fields-enabled variants with matching toolsnaps and docs. - Adds a runtime feature check before
get_issueGraphQL field-value enrichment.
Show a summary per file
| File | Description |
|---|---|
| README.md | Removes issue_fields from default issue_write docs. |
| pkg/inventory/server_tool.go | Updates tool feature flag fields to slices. |
| pkg/inventory/resources.go | Updates resource feature flag fields to slices. |
| pkg/inventory/prompts.go | Updates prompt feature flag fields to slices. |
| pkg/inventory/filters.go | Implements multi-flag filtering semantics. |
| pkg/inventory/registry_test.go | Updates inventory tests for slice-based feature flags. |
| pkg/http/handler_test.go | Updates HTTP inventory tests for slice-based feature flags. |
| pkg/github/tools.go | Registers the legacy issue_write variant. |
| pkg/github/tools_validation_test.go | Updates duplicate-tool validation for slice flags. |
| pkg/github/pullrequests.go | Migrates PR consolidated tools to slice disable flags. |
| pkg/github/pullrequests_granular.go | Migrates PR granular tools to slice enable flags. |
| pkg/github/issues.go | Gates get_issue enrichment and adds legacy/flagged issue_write. |
| pkg/github/issues_test.go | Updates issue tool snapshots/tests for split variants. |
| pkg/github/issues_granular.go | Migrates issue granular tools to slice enable flags. |
| pkg/github/issue_fields.go | Migrates issue-fields tool to slice enable flags. |
| pkg/github/granular_tools_test.go | Updates granular tool tests for slice flags. |
| pkg/github/csv_output_test.go | Updates CSV wrapper tests for slice flags. |
| pkg/github/toolsnaps/issue_write.snap | Updates base issue_write schema to legacy shape. |
| pkg/github/toolsnaps/issue_write_ff_remote_mcp_issue_fields.snap | Adds flagged issue_write schema snapshot. |
| docs/insiders-features.md | Documents flagged issue_write for insiders. |
| docs/feature-flags.md | Documents flagged issue_write under remote_mcp_issue_fields. |
Copilot's findings
- Files reviewed: 21/21 changed files
- Comments generated: 2
This comment was marked as spam.
This comment was marked as spam.
Contributor
Author
|
Testing
Input: { "method": "get", "owner": "github", "repo": "planning-tracking-demo", "issue_number": 1993 }Output: {
"number": 1993,
"title": "[test] flag gating sanity - flag ON",
"state": "open",
"issue_type": "Task",
"field_values": [
{ "field": "Priority", "value": "P3" },
{ "field": "Visibility", "value": "Low" }
]
}
Input: { "method": "get", "owner": "github", "repo": "planning-tracking-demo", "issue_number": 1993 }Output: {
"number": 1993,
"title": "[test] flag gating sanity - flag ON",
"state": "open",
"issue_type": "Task"
}For |
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Gates
issue_writeandget_issuefield enrichment behind theremote_mcp_issue_fieldsfeature flag. Stacks on top of #2551.Extends the inventory
FeatureFlagEnable/FeatureFlagDisablefields fromstringto[]string(AND semantics for enable, OR for disable) to avoid 4-way tool duplication when gating against multiple flags simultaneously.Why
issue_writeexposesissue_fields(Issues 2.0) andget_issueruns an extra GraphQL round-trip for field values — both should only happen when the flag is on, consistent with howlist_issuesandsearch_issueswere gated in #2520.What changed
FeatureFlagEnable/FeatureFlagDisableonServerTool,ServerResourceTemplate,ServerPromptchanged fromstringto[]string;featureFlagAllowedupdated with range loops (enable = all must pass, disable = any blocks)LegacyIssueWrite: newFeatureFlagDisable = []string{FeatureFlagIssuesGranular, FeatureFlagIssueFields}variant — noissue_fieldsschema param, passesnilfield valuesIssueWrite: gainsFeatureFlagEnable = []string{FeatureFlagIssueFields}— only active when flag is onget_issuefield_values enrichment wrapped inIsFeatureEnabled(ctx, FeatureFlagIssueFields)runtime checkissue_write.snap(legacy) +issue_write_ff_remote_mcp_issue_fields.snap(flag-enabled), following feat(issues): gate issue-fields features behind remote_mcp_issue_fields flag #2520 conventionfeatureFlagAlloweddisable loop modernised toslices.ContainsFuncMCP impact
issue_writeschema splits into two registrations;issue_fieldsparam only visible when flag is onPrompts tested (tool changes only)
issue_writewithissue_fields✅get_issuereturnsfield_values: [{Priority: P2}, {Visibility: Medium}]✅Security / limits
Tool renaming
Lint & tests
./script/lint./script/testDocs