Skip to content

feat(issues): gate issue-fields features behind remote_mcp_issue_fields flag#2520

Merged
SamMorrowDrums merged 2 commits into
mainfrom
sammorrowdrums/gate-issue-fields-feature-flag
May 21, 2026
Merged

feat(issues): gate issue-fields features behind remote_mcp_issue_fields flag#2520
SamMorrowDrums merged 2 commits into
mainfrom
sammorrowdrums/gate-issue-fields-feature-flag

Conversation

@SamMorrowDrums

Copy link
Copy Markdown
Collaborator

Gates the recently merged issue-fields work behind a new feature flag (remote_mcp_issue_fields), also enabled in insiders mode, so it can be rolled out independently.

What's gated

  • list_issue_fields tool — registered only when flag is enabled (FeatureFlagEnable).
  • search_issues field_values enrichment — runtime check; the GraphQL field-values lookup is skipped when the flag is off.
  • list_issues — split into two same-named registrations:
    • The field-aware variant (existing schema with field_filters input and field_values output) requires the flag.
    • LegacyListIssues (FeatureFlagDisable) preserves the prior schema and GraphQL selection set, so disabled callers don't pay extra wire/server cost.

Approach

Per discussion, we deliberately duplicate the GraphQL types and query path for list_issues rather than runtime-strip. GraphQL cost is paid at field-selection time, and duplication makes flag removal trivial — just delete whichever branch we don't keep.

Toolsnap convention

Adopted <tool>_ff_<flag>.snap for flagged variants so same-named duplicates each get a distinct snapshot:

  • list_issues.snap — legacy schema
  • list_issues_ff_remote_mcp_issue_fields.snap — field-aware schema

No changes to internal/toolsnaps were needed; the helper already takes the snap filename from the caller.

Validation

  • script/lint — 0 issues
  • script/test — all packages pass
  • script/generate-docs — README + docs updated
  • script/print-mcp-diff-configs auto-emits a --features=remote_mcp_issue_fields matrix entry

Follow-up

The inbound issue_write field-changes PR will need to layer this flag on top of FeatureFlagIssuesGranular. That's expressible with the existing single-string flag fields (4-way duplication) — deferred to that PR.

…ds flag

Gates the recently merged issue-fields work (list_issue_fields tool,
field_values enrichment on list_issues/search_issues, and field_filters
input on list_issues) behind a new feature flag, also enabled in
insiders mode.

- list_issues splits into two same-named registrations: the field-aware
  variant requires the flag, while LegacyListIssues (FeatureFlagDisable)
  preserves the prior schema and GraphQL selection set so disabled
  callers don't pay the extra wire/server cost.
- search_issues skips the field-values lookup when the flag is off.
- list_issue_fields requires the flag to be registered at all.
- Adopts <tool>_ff_<flag>.snap naming for flagged toolsnap variants so
  same-named duplicates each get a distinct snapshot.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@SamMorrowDrums SamMorrowDrums requested a review from a team as a code owner May 21, 2026 20:41
Copilot AI review requested due to automatic review settings May 21, 2026 20:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 a new feature flag (remote_mcp_issue_fields) to gate Issues 2.0 custom-field functionality so it can be rolled out independently without impacting callers that don’t opt in.

Changes:

  • Adds FeatureFlagIssueFields (remote_mcp_issue_fields) to the allowed + insiders feature flag lists.
  • Splits list_issues into two mutually-exclusive registrations (flag-enabled field-aware variant vs. flag-disabled legacy variant) and gates list_issue_fields registration behind the same flag.
  • Skips search_issues field-values enrichment unless the flag is enabled, and adds a separate toolsnap for the flag-enabled list_issues schema.
Show a summary per file
File Description
README.md Updates generated tool documentation (currently shows duplicate list_issues entries).
pkg/github/tools.go Registers LegacyListIssues alongside the flag-enabled ListIssues.
pkg/github/minimal_types.go Adds legacy GraphQL fragment → minimal response conversion helpers.
pkg/github/issues.go Adds legacy GraphQL query types + handler; gates search_issues enrichment; adds feature-flag annotations for both list_issues variants.
pkg/github/issues_test.go Updates toolsnap expectations for the flag-enabled list_issues variant and adds tests for LegacyListIssues.
pkg/github/issue_fields.go Gates list_issue_fields tool registration behind FeatureFlagIssueFields.
pkg/github/feature_flags.go Defines FeatureFlagIssueFields and includes it in Allowed/Insiders feature flag sets.
pkg/github/toolsnaps/list_issues.snap Updates canonical list_issues snap to the legacy schema (no field_filters).
pkg/github/toolsnaps/list_issues_ff_remote_mcp_issue_fields.snap Adds a new toolsnap for the flag-enabled list_issues schema variant.

Copilot's findings

  • Files reviewed: 9/9 changed files
  • Comments generated: 3
Comment thread README.md
Comment on lines +912 to +916
- **list_issues** - List issues
- **Required OAuth Scopes**: `repo`
- `after`: Cursor for pagination. Use the endCursor from the previous page's PageInfo for GraphQL APIs. (string, optional)
- `direction`: Order direction. If provided, the 'orderBy' also needs to be provided. (string, optional)
- `labels`: Filter by labels (string[], optional)
Comment thread pkg/github/issues.go
Comment thread pkg/github/issue_fields.go
- docs generator: install a no-flags feature checker so README reflects
  the default user experience (tools enabled with no special flags),
  fixing duplicate `list_issues` and removing granular/flagged-only
  tools that were never meant to appear in the default docs.
- csv_output: drop the FeatureFlagEnable/Disable exclusion in
  isCSVOutputTool. Wrapping happens before the per-request flag filter
  picks the live variant, so flag-gated list_* tools wrap safely; this
  restores CSV conversion for `list_issues` and enables it for
  `list_issue_fields` when both flags are on.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@SamMorrowDrums SamMorrowDrums merged commit f5e26a8 into main May 21, 2026
19 checks passed
@SamMorrowDrums SamMorrowDrums deleted the sammorrowdrums/gate-issue-fields-feature-flag branch May 21, 2026 21:01
SamMorrowDrums pushed a commit that referenced this pull request May 27, 2026
- 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 #2520.

- Modernise featureFlagAllowed disableFlags loop to slices.ContainsFunc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants