github-mcp-server icon indicating copy to clipboard operation
github-mcp-server copied to clipboard

fix: add authorAssociation to IssueFragment (GraphQL path)

Open lanxevo3 opened this issue 8 months ago • 5 comments

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

lanxevo3 avatar Mar 26 '26 20:03 lanxevo3

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.

lanxevo3 avatar Mar 30 '26 18:03 lanxevo3

Hi, I will try to look and get this in soon. It does make sense to provide the data.

SamMorrowDrums avatar Apr 10 '26 07:04 SamMorrowDrums

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.String to IssueFragment (and LegacyIssueFragment for the flag-disabled path)
  • Removed the incorrect Author.Association nested field from the original PR

pkg/github/minimal_types.go

  • fragmentToMinimalIssue() and legacyFragmentToMinimalIssue() now set AuthorAssociation: string(fragment.AuthorAssociation)
  • Also added author_association to MinimalPullRequest / 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).

advancedresearcharray avatar Jun 06 '26 04:06 advancedresearcharray

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):

  1. Ready branch: https://github.com/advancedresearcharray/github-mcp-server/tree/fix/author-association-issue-fragment-2265
  2. PR to update author's fork: https://github.com/lanxevo3/github-mcp-server/pull/1 — merging this updates the #2265 head branch
  3. 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.

advancedresearcharray avatar Jun 06 '26 04:06 advancedresearcharray

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.String to IssueFragment (and LegacyIssueFragment)
  • Removed the incorrect Author.Association nested field

pkg/github/minimal_types.go

  • fragmentToMinimalIssue() and legacyFragmentToMinimalIssue() now set AuthorAssociation: string(fragment.AuthorAssociation)
  • Added author_association to MinimalPullRequest / 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_association assertions 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.

advancedresearcharray avatar Jun 06 '26 05:06 advancedresearcharray