fix: add authorAssociation to IssueFragment (GraphQL path)
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.StringtoIssueFragmentandLegacyIssueFragment
pkg/github/minimal_types.go
fragmentToMinimalIssue()andlegacyFragmentToMinimalIssue()setAuthorAssociationfrom the top-level field- Added
author_associationtoMinimalPullRequestviaconvertToMinimalPullRequest()(#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_associationis populated inpull_request_readandlist_pull_requestsresponses
Rebased on current main. go test ./pkg/github/ -count=1 passes.
Fixes #2250. Supersedes #2265 (original author fork not writable).
@SamMorrowDrums — this addresses your review feedback on #2265:
authorAssociationis now a top-level field onIssueFragment/LegacyIssueFragment(not nested underActor.author)fragmentToMinimalIssue()andlegacyFragmentToMinimalIssue()read it from the top-level fieldMinimalPullRequest.author_associationis populated on the REST path viaconvertToMinimalPullRequest()(#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.
@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.
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.
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:
authorAssociationis a top-level field onIssueFragment(GraphQL schema-correct)fragmentToMinimalIssue()populatesAuthorAssociationMinimalPullRequest.author_associationpopulated viaconvertToMinimalPullRequest()(#2250)- Tests updated for GraphQL (
list_issues) and REST (pull_request_read,list_pull_requests) paths
Ready for re-review.