Repository navigation
π fix(adoption): name the branch update a person must run when a fork PR is blocked by base workflow changes - #17549
Conversation
β¦ base changed workflows A fork PR the hive cannot finish because its base changed .github/workflows/ parked at 085 (adoption-stalled:fork-rehome-refused) with a general "bring it into the repository yourself or close it" ask. GitHub refuses any App push to a fork that carries a workflow change, whatever the App is granted on the base repository, so the one action is a person's branch update. The note now reads the fork's maintainer_can_modify and the base-side workflow change when it is posted and names that action (Update branch / gh pr update-branch, or a local merge on a conflict), or the author's step when maintainer edits are off. Refs projectbluefin/common#1611, projectbluefin/utah-packages#812 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 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. Reviewed by Reviewer notesRead the non-test diff against the v6 tree ( What I checked:
Body and diff agree. |
There was a problem hiding this comment.
Read the diff against the v6 tree. This looks correct to me, and the extra reads are bounded as the body claims.
What I checked:
- No new API traffic on the hot path. In
escapeStalledAdoption(automerge_contributor_adopt.go:2655-2669) thenotedearly-return fires beforeforkUpdateBlockForis reached, andpostAdoptionEscalationNotemarks the head immediately after posting, so thePullRequests.Get+ compare run once per head, and only on thefork-rehome-refusedbranch.escalateUnadoptableForkis guarded the same way. baseSyncTouchesWorkflowsis behaviour-preserving. The refactor intobaseSyncWorkflowFilekeeps "compare failed β treat as touching (supersede)" and "first.github/workflows/file β touching"; the pagination loop is unchanged, only the log lines moved to the wrapper.- Zero-value fallback is intact. All three exported entry points (
AdoptionStalledComment,adoptionBlockerText,ForkNotAdoptedComment) passforkUpdateBlock{}, which selects the pre-existing general-ask text verbatim β callers outside this file see no change. adoptionFromForkandsupersedeHeadConflictsalready exist in this file (:2038,:1362); the conflict sentence correctly switches to the local-merge instruction when the head already conflicts.
Shares stage-labels.md with #17551 but in different hunks (@@ -944 here vs @@ -465 there), so no conflict between the two.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
Summary: When a contributor's fork PR falls behind a base that changed
.github/workflows/, the hive cannot bring the fork up to date. GitHub refuses any App push to a fork that carries a workflow change, whatever the App is granted on the base repository. The hive already handles this in the merge sweep: it triesupdate-branchand parks withfork-workflow-update, naming the exact step. The adoption path did not do the same. There the PR parked at 085 asadoption-stalled:fork-rehome-refusedwith a general "bring it into the repository yourself or close it". That is how projectbluefin/utah-packages#812 ended up re-homed by hand. Now that note names the one action: a person runs Update branch /gh pr update-branch, or merges the base in locally if it conflicts. When the fork allows no maintainer edits, the note names the author's step instead. No permission changes, no new writes, and no change to when the hive parks.What went wrong
mendezr/utah-packages): adopted in place on 10-31. On 11-01 the scanner's push was rejected because the rebased history carriedmain's change tobump-upstream-enqueue.yml. The hive then parked it at 085 withadoption-stalled:fork-rehome-refusedand the general ask. A maintainer re-homed it by hand as perf: O(1) contributor lookup by usernameΒ #892 on 11-06. That manual bottleneck is what projectbluefin/common#1611 asks to remove.workflowspermission on projectbluefin. Its declared permissions includeworkflows: write, and it pushed workflow files itself: utahc3d4f319(10-26), website#991, dakota-iso#303 and actions#726 (11-05). Despite that, GitHub refused fork updates that carried base workflow changes on utah#1001 (10-29), fsdk-containers#505 (11-05 to 11-09) and utah-packages#977 (live log, 11-10 06:08Z). The refusal comes from the fork, where the App is not installed, so no grant fixes it.baseSyncTouchesWorkflows) and never moves fork code into the base repository. The only gap was that the 085 note did not say why or what to do.What changes
fork-rehome-refusednote, it reads two things about the fork:maintainer_can_modify, and the first.github/workflows/file the base changed since the merge-base. This happens once per head, in both the "not adopted after the 072 dwell" path and the "adopted, re-home refused" path.gh pr update-branch N -R owner/repo, or asks the author to. If the fork has maintainer edits off, the ask goes to the author or asks them to turn edits on. On a conflict, the note says to merge the base in locally and push. A merge keeps the contributor's commits and sign-off.baseSyncTouchesWorkflowsnow reads through a smallbaseSyncWorkflowFilehelper that returns the file. Its result and log lines are the same as before.Files
src/pkg/github/automerge/automerge_contributor_adopt.go:forkUpdateBlock,forkUpdateBlockFor,forkRehomeBlockerTextFor,baseSyncWorkflowFile; the two note sites pass the block through.src/pkg/github/automerge/automerge_fork_update_block_test.go: new tests.src/docs/labels-and-control-signals/stage-labels.md,src/docs/hive-merge.md: the fork park note.changelog.d/fixed-fork-workflow-sync-park.md.Tests
None were run locally (repo AGENTS.md). CI is the verdict.
TestForkRehomeBlockerTextNamesTheUpdate: the four note variants (workflow change with edits on, workflow change plus conflict with edits off, edits off only, nothing read). It also checks that the general text is unchanged.TestForkNotAdoptedForBaseWorkflowChangeNamesUpdateBranch: the fork is behind a base that changed a workflow file and has maintainer edits on. It is not adopted, and after the 072 dwell its 085 note names the file andgh pr update-branch 7 -R acme/widget. On the v6 tip the note carries the general "follow the repository's process" ask, so this test fails there.TestAdoptedForkConflictAfterBaseWorkflowChangeNamesUpdate: replays fix: remove PhaseChangedAt filter + strict content checksΒ #812's path. The fork is adopted in place, the base then changes a workflow file, and the branch needs a rebase. The re-home is refused, and the 085 note names the conflict and the update. On the tip the note lacks both.TestAdoptionForkWithoutPushStaysWithAuthorUntilDwell,assertForkRehomeParkedcallers) assert phrases that every variant keeps.Not in this PR
Refs projectbluefin/common#1611, Refs projectbluefin/utah-packages#812, Refs #15382
π€ Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1