Repository navigation
π fix(github): fork PRs that allow maintainer edits no longer read as unpushable when the GraphQL PR batch is on - #16995
Conversation
The GraphQL PR batch stored each PR's detail without maintainerCanModify,
and EnrichCIStatus reuses that detail in place of a REST GET, so every
fork PR read as not editable. The hold guard then stopped keeping held
fork PRs current without asking GitHub ("a fork the Hive app cannot push
to") on projectbluefin/gutenprint-printer-app#196 and hplip-printer-app#199,
whose forks allow maintainer edits. ReachableAction and the dashboard's
adopted-push check read the same field.
Ask for maintainerCanModify in the batch query and carry it into the
stored detail.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@Danathar this PR is back in your court ( Failing checks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Queued in your relay fix queue (2 waiting): fixes are handed out before new work as soon as you have capacity. |
There was a problem hiding this comment.
Read the batch path and its consumer in the tree at 8325a54d; the fix is correct and complete for the mechanism described.
Mechanism verified. EnrichCIStatus reuses the batch-stored detail via cachedPRDetailFromList (src/pkg/github/client.go:2819) and then copies full.GetMaintainerCanModify() into pr.MaintainerCanModify (client.go:2832). Before this change storeGraphQLPRBatchNode (src/pkg/github/pr_batch_graphql.go:254-275) built the gh.PullRequest with MaintainerCanModify unset, so GetMaintainerCanModify() returned false for every fork PR whenever the batch was on. The cache clone already preserves the field (src/pkg/github/prdetailcache.go:228), so adding it to the GraphQL query and the stored detail is the whole fix. Downstream readers β pr_merge_state.go:57,77,85, dashboard/adopted_push.go:54, ReachableAction β all take the value from this one field.
Two things I checked that are not affected: automerge_contributor_adopt.go:1904,1919 call c.gh.PullRequests.Get directly, not the cache, so they were never wrong and are unchanged by this. And pushAccessLost distinguishes nil from false; the stored detail now sets a non-nil pointer, matching what the REST read produces.
The test exercises the real path (GraphQL prefetch β EnrichCIStatus with REST GET asserting zero) and checks both polarities plus ReachableAction. go build ./pkg/github/ passes on the PR head.
CI: the native-queue-policy failure is not this PR β the job dies in the "Replay last verdict for cosmetic label flips" step with TypeError: isCosmeticLabelFlip is not a function before any policy evaluation, which is a workflow-side defect on the base branch (see #16988). Looks correct to me.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
β¦ner-edits Signed-off-by: Danathar <Danathar@users.noreply.github.com>
|
The hive's GitHub App lacks |
|
Needs a decision, not a merge: Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
β¦ CI incident is withdrawn (#17007) The 072 nudge goes out the moment a contributor PR goes red ("the hive will not merge it until the head changes"). The scanner's [shared-ci] incident marker can land minutes later. The stage pass then moved the PR to 050, but the nudge stayed as posted and the head's nudge count stayed at 1. Seen on hivecommons/hive #16993, #16995, #17000 and #17001: nudged for native-queue-policy about ten minutes before they were deferred to incident #17003. - When the pass reads a nudged head's red as shared-ci-incident:<n> or base-branch-red:<checks>, edit the hive's own nudge comments for that head in place to say it was withdrawn, and forget the nudge (Store.WithdrawNudge), so a genuine return to 072 is nudged afresh. - After an incident closes as completed, keep a PR deferred to it until the rerun sweep stamps hive-shared-ci-rerun-<n> (at most 30 minutes), so the head is not handed back in the gap before the re-run. - Name the head's red checks in the nudge when the CI gate's reason is a bare token such as check-failure (a base with no required checks). Refs #17003, #12606, #12253 Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 Signed-off-by: Danathar <Danathar@users.noreply.github.com> Co-authored-by: Danathar <Danathar@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Conclusion: looks correct to me. The diff fixes exactly the mechanism it describes, and I confirmed the read path in the tree rather than from the body.
pkg/github/client.go:2639βenrichPRCItakes the cached detail viacachedPRDetailFromListand skips the REST GET when it hits.pkg/github/client.go:2654βpr.MaintainerCanModify = full.GetMaintainerCanModify(); with the GraphQL node never setting the field,go-github's getter returnsfalsefor every PR, forks included.pkg/github/prdetailcache.go:228β the cache clone already carriesMaintainerCanModify, so oncestoreGraphQLPRBatchNodepopulates it (this diff,pr_batch_graphql.go) nothing else needs to change downstream.- Consumers that now get the real value:
client.go:3680(pr.FromFork && !pr.MaintainerCanModify),pr_merge_state.go:57/:85, andReachableActionas the new test asserts.
The test is a genuine redβgreen: it fails on main because the node JSON gains maintainerCanModify but the Go struct has nowhere to put it, so prs[0].MaintainerCanModify stays false. It also pins "no REST pull GET", which is the property that made this bug invisible.
One non-blocking note: the changelog fragment is a single very long paragraph with repo-specific PR links; a shorter user-facing line would read better in the release notes, but that is the hive's own call.
No security, scope or docs concerns. I have not approved or changed anything.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. Reviewed by Reviewer notesLooks correct to me. Verified the mechanism in the tree at merge-base, not just the diff.
No findings. Only |
Summary
The GraphQL PR batch (
graphql_pr_batch, on by default) stores each open PR's detail withoutmaintainerCanModify. The scan reuses that stored detail instead of making a REST call, so every fork PR came out as "maintainer edits off". The hold guard trusted that value and stopped keeping held fork PRs up to date without ever asking GitHub, then told people the fork could not be pushed to. This PR addsmaintainerCanModifyto the batch query and keeps it in the stored detail.What went wrong
maintainerCanModify: truefromgh pr view).reason=fork-not-editableand noerrorfield.stopHeldPRUpdateaddserrorwhenever GitHub refused the update, so this came from the guard's own early check (pr.FromFork && !pr.MaintainerCanModifyincmd/hive/main_helpers.go). GitHub was never asked.enrichPRCI. It copiesMaintainerCanModifyfrom the cached PR detail, and when the batch is on, that cached detail is the onestoreGraphQLPRBatchNodebuilt without the field.The adoptions on these PRs (and on ghostscript-printer-app#190) were not the bug. The nudge/grace adoption path already checks push access with a fresh REST read (
canPushToPRBranch), and these forks allowed edits when they were adopted. The real blocker on all three is upstream: the shared fsdk-containers slim-printing include (projectbluefin/fsdk-containers#509). The hive's scanner already said so on the PRs.What changes
maintainerCanModify, and the stored detail carries it.PullRequest.MaintainerCanModifyafter enrichment now gets GitHub's real answer when the batch is on. That covers the hold guard's early stop,ReachableAction(push vs comment-only in the repair queue) and the dashboard's adopted-PR push check.Files
src/pkg/github/pr_batch_graphql.go: query field, node field, stored detail.src/pkg/github/pr_batch_graphql_maintainer_edits_test.go: new test.changelog.d/fixed-graphql-batch-maintainer-edits.mdTests
TestGraphQLPRBatchCarriesMaintainerCanModify: two fork PRs from the batch, one with edits allowed and one without. Enrichment must reuse the batch detail (no REST GET) and report each correctly, andReachableActionmust say push for the editable one. It fails on v6 tip ("fork PR that allows maintainer edits read as not editable") and passes with this change.go test ./pkg/github/andgo vet ./pkg/github/pass. Thecmd/hivehold-guard tests (-run 'Held|HoldGuard') pass.π€ Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1