fix: add authorAssociation to IssueFragment (GraphQL path)
Summary
Adds the missing \uthorAssociation\ field to the \IssueFragment\ GraphQL struct and populates it in \ragmentToMinimalIssue(), fixing the missing \uthor_association\ field in \list_issues\ responses when using the GraphQL path.
Changes
- \pkg/github/issues.go: Added \Author.Association\ field to \IssueFragment\ struct (GraphQL)
- \pkg/github/minimal_types.go: Set \AuthorAssociation\ in \ragmentToMinimalIssue()\ from \ragment.Author.Association\
Note
The REST path (\convertToMinimalIssue()) already correctly sets \AuthorAssociation\ from \issue.GetAuthorAssociation(). The GraphQL path was missing this field.
Fixes #2250
Hey @github/mcp-team — checking in on this PR. It's been open since March 26 and is mergeable. Adds uthorAssociation field to IssueFragment to fix the GraphQL codegen path. Any blockers or feedback? Happy to iterate.
Hi, I will try to look and get this in soon. It does make sense to provide the data.
Addressed the review feedback from @SamMorrowDrums — authorAssociation is a top-level field on the Issue node, not on Actor.
Changes
pkg/github/issues.go
- Added
AuthorAssociation githubv4.StringtoIssueFragment(andLegacyIssueFragmentfor the flag-disabled path) - Removed the incorrect
Author.Associationnested field from the original PR
pkg/github/minimal_types.go
fragmentToMinimalIssue()andlegacyFragmentToMinimalIssue()now setAuthorAssociation: string(fragment.AuthorAssociation)- Also added
author_associationtoMinimalPullRequest/convertToMinimalPullRequest()for the REST path (#2250)
pkg/github/issues_test.go
- Updated GraphQL query matchers to include
authorAssociation - Mock responses now use top-level
authorAssociation(matching the live schema) - Added assertions that the field is populated in responses
Ready branch
Rebased on current main (includes #2605): https://github.com/advancedresearcharray/github-mcp-server/tree/fix/author-association-issue-fragment-2265
Compare: https://github.com/github/github-mcp-server/compare/main...advancedresearcharray:fix/author-association-issue-fragment-2265
go test ./pkg/github/ -count=1 passes.
@lanxevo3 — if you can cherry-pick or merge that branch onto main in your fork, this should be ready for re-review. @SamMorrowDrums — happy for you to push the fix on top here if that's easier (maintainer edits are enabled).
Updated the fix branch per @SamMorrowDrums's review feedback — authorAssociation is now a top-level field on IssueFragment (not nested under Actor.author), with tests and MinimalPullRequest.author_association included.
Verification: go test ./pkg/github/ -count=1 passes on current main.
Delivery options (no write access to lanxevo3/github-mcp-server):
- Ready branch: https://github.com/advancedresearcharray/github-mcp-server/tree/fix/author-association-issue-fragment-2265
- PR to update author's fork: https://github.com/lanxevo3/github-mcp-server/pull/1 — merging this updates the #2265 head branch
- Upstream PR with the fix: #2620 — maintainers can merge this directly if preferred
@SamMorrowDrums — since maintainer edits are enabled on this PR, pushing the fix branch onto lanxevo3/main would also unblock re-review here. Happy to close #2265 in favor of #2620 if that's easier.
Addressed @SamMorrowDrums's review feedback — authorAssociation is now a top-level field on IssueFragment (not nested under Actor.author), with tests and MinimalPullRequest.author_association included.
Changes (4 files)
pkg/github/issues.go
- Added
AuthorAssociation githubv4.StringtoIssueFragment(andLegacyIssueFragment) - Removed the incorrect
Author.Associationnested field
pkg/github/minimal_types.go
fragmentToMinimalIssue()andlegacyFragmentToMinimalIssue()now setAuthorAssociation: string(fragment.AuthorAssociation)- Added
author_associationtoMinimalPullRequest/convertToMinimalPullRequest()for the REST path (#2250)
pkg/github/issues_test.go
- Updated GraphQL query matchers to include
authorAssociation - Mock responses now use top-level
authorAssociation(matching the live schema) - Added assertions that the field is populated in responses
pkg/github/pullrequests_test.go
- Added
author_associationassertions for get/list pull request handlers
Verification
go test ./pkg/github/ -count=1 -run 'Test_ListIssues|Test_GetPullRequest|Test_ListPullRequests' passes.
Delivery
Ready branch rebased on this PR's head: https://github.com/advancedresearcharray/github-mcp-server/tree/fix/pr-2265-review-feedback
Mergeable PR to update this head branch: https://github.com/lanxevo3/github-mcp-server/pull/2
@SamMorrowDrums — maintainer edits are enabled; pushing the fix branch onto lanxevo3/main would unblock re-review here. Alternatively, the same fix on current main is in #2620.