-
Notifications
You must be signed in to change notification settings - Fork 1.8k
## Pull request overview #2420
Open
Description
Pull request overview
This PR extends the issues tool surface to support reading and writing GitHub Issues 2.0 custom field values, aligning issue_read/issue_write behavior with the newer REST/GraphQL capabilities introduced alongside the go-github upgrade.
Changes:
- Added
issue_fieldsinput toissue_write, including name-based resolution of field IDs and (for single-select) option validation. - Expanded
issue_readoutput handling to include RESTissue_field_values, and added best-effort GraphQL enrichment to normalize tofield_valueswhere possible. - Updated minimal/DTO types and unit tests to cover issue field value parsing and write request shaping.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents the new issue_fields input for issue_write. |
| pkg/github/minimal_types.go | Adds REST-backed minimal issue field value types and separates REST issue_field_values from GraphQL-normalized field_values. |
| pkg/github/issues.go | Implements parsing + GraphQL metadata resolution for issue_fields, wires field values into create/update, and adjusts search/get enrichment paths. |
| pkg/github/issues_test.go | Adds/updates tests for get/write behavior involving issue field values. |
| pkg/github/issue_fields.go | Fetches/stores GraphQL fullDatabaseId for issue fields and adds parsing helper. |
| pkg/github/issue_fields_test.go | Updates expectations to include fullDatabaseId/DatabaseID. |
| pkg/github/toolsnaps/issue_write.snap | Updates tool schema snapshot to include issue_fields. |
| docs/insiders-features.md | Reflects the issue_fields parameter in generated docs. |
| docs/feature-flags.md | Reflects the issue_fields parameter in generated docs. |
Copilot's findings
Comments suppressed due to low confidence (1)
pkg/github/issues.go:1599
searchIssuesHandlernow always performs GraphQL field_values enrichment whenever there are results, and returns an error if GraphQL is unavailable or the query fails. This looks like a regression of the documented behavior ofFeatureFlagIssueFields(which is meant to gate search_issues field_values enrichment); please restore the feature-flag check so search_issues works without GraphQL issue fields features enabled.
var fieldValuesByID map[string][]MinimalFieldValue
if len(result.Issues) > 0 {
gqlClient, err := deps.GetGQLClient(ctx)
if err != nil {
return utils.NewToolResultErrorFromErr(errorPrefix+": failed to get GitHub GraphQL client", err), nil
}
fieldValuesByID, err = fetchIssueFieldValuesByNodeID(ctx, gqlClient, result.Issues)
if err != nil {
return ghErrors.NewGitHubGraphQLErrorResponse(ctx, errorPrefix+": failed to fetch issue field values", err), nil
}
}
- Files reviewed: 9/9 changed files
- Comments generated: 2
Originally posted by @copilot-pull-request-reviewer in github/github-mcp-server#2551 (review)
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.