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

fix: add authorAssociation to IssueFragment (GraphQL path)

Open advancedresearcharray opened this issue 5 months ago • 3 comments

Addresses the CHANGES_REQUESTED review on #2265. The original PR placed authorAssociation on Actor.author, which does not exist in the GitHub GraphQL schema — it is a top-level field on the Issue node.

Changes

pkg/github/issues.go

  • Added AuthorAssociation githubv4.String to IssueFragment and LegacyIssueFragment

pkg/github/minimal_types.go

  • fragmentToMinimalIssue() and legacyFragmentToMinimalIssue() set AuthorAssociation from the top-level field
  • Added author_association to MinimalPullRequest via convertToMinimalPullRequest() (#2250)

pkg/github/issues_test.go

  • Updated GraphQL query matchers to include authorAssociation
  • Mock responses use top-level authorAssociation
  • Added assertions that the field is populated

pkg/github/pullrequests_test.go

  • Assert author_association is populated in pull_request_read and list_pull_requests responses

Rebased on current main. go test ./pkg/github/ -count=1 passes.

Fixes #2250. Supersedes #2265 (original author fork not writable).

advancedresearcharray avatar Jun 06 '26 04:06 advancedresearcharray

@SamMorrowDrums — this addresses your review feedback on #2265:

  • authorAssociation is now a top-level field on IssueFragment / LegacyIssueFragment (not nested under Actor.author)
  • fragmentToMinimalIssue() and legacyFragmentToMinimalIssue() read it from the top-level field
  • MinimalPullRequest.author_association is populated on the REST path via convertToMinimalPullRequest() (#2250)
  • Tests cover both GraphQL (list_issues) and REST (pull_request_read, list_pull_requests) paths

Rebased on current main (457f599). go test ./pkg/github/ -count=1 passes locally.

Ready for re-review when you have a moment.

advancedresearcharray avatar Jun 06 '26 05:06 advancedresearcharray

@SamMorrowDrums — rebased commits are clean (no co-author trailers). Verified locally with `script/test` on Go 1.25.

This addresses your #2265 review:

  • `authorAssociation` is a top-level field on `IssueFragment` / `LegacyIssueFragment`
  • `fragmentToMinimalIssue()` and `legacyFragmentToMinimalIssue()` populate `AuthorAssociation`
  • `MinimalPullRequest.author_association` is set via `convertToMinimalPullRequest()` (#2250)
  • Tests cover GraphQL (`list_issues`) and REST (`pull_request_read`, `list_pull_requests`) paths

CI workflows are still awaiting maintainer approval for this fork PR. Ready for re-review when you have a moment.

advancedresearcharray avatar Jun 06 '26 20:06 advancedresearcharray

Merge-ready check-in

This PR looks ready for maintainer review/merge when you have a moment.

  • Change: fix: add authorAssociation to IssueFragment (GraphQL path)
  • CI: green / passing
  • Review: REVIEW_REQUIRED (mergeable: MERGEABLE)

Happy to rebase or address any remaining feedback. Thanks for maintaining the project.

advancedresearcharray avatar Jun 12 '26 17:06 advancedresearcharray

Rebased onto current main (8cd03c0) and force-pushed a clean commit without legacy LegacyIssueFragment code (removed upstream since the original PR).

Verified locally: go test ./pkg/github/ -count=1 passes.

Changes:

  • authorAssociation is a top-level field on IssueFragment (GraphQL schema-correct)
  • fragmentToMinimalIssue() populates AuthorAssociation
  • MinimalPullRequest.author_association populated via convertToMinimalPullRequest() (#2250)
  • Tests updated for GraphQL (list_issues) and REST (pull_request_read, list_pull_requests) paths

Ready for re-review.

advancedresearcharray avatar Jun 29 '26 21:06 advancedresearcharray