Repository navigation
🐛 fix: refuse workflow-changing fork rebase follow-through - #15583
Conversation
|
[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
|
There was a problem hiding this comment.
Conclusion: this branch is byte-identical to #15307 (same head a46bcae867d2), so the review I left there applies unchanged — see #15307 (review) (my comment at that head). Carrying the one finding over so whoever rebases hive/adopt-15307 sees it in place:
Finding (medium) — hive-authored bypass dropped, unstated. src/pkg/dashboard/rebase_merge_followthrough.go:65 changes if !hiveAuthored && !st.PushReachable() to if !st.PushReachable(). On v5 a hive-authored PR whose head lives in a fork without maintainer edits was armed and rebased (the hive owns that branch and can push regardless of maintainer_can_modify); after this change it is refused at arm time with head-not-pushable. The body says ordinary fork rebases keep their behaviour, and neither new test exercises IsHiveAuthorLogin(st.Author) with FromFork && !MaintainerCanModify.
Suggested shape if only the workflow fence is intended:
if len(st.WorkflowPushPaths) > 0 || (!hiveAuthored && !st.PushReachable()) {Everything else I verified on #15307 (both compare directions, rename handling via GetPreviousFilename() at pr_merge_state.go:175-179, ticker drift settlement at :239-245, no adopt-fresh on FailWorkflowPush) still holds here. When the rebase resolves the v5 conflicts, please address the bypass in the same push.
Not a duplicate to close: #15583 is the intended supersession of #15307, which should be the one closed once this lands.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Conclusion: this branch is byte-identical to #15307 (same head a46bcae867d2), so the one open finding on that PR applies here verbatim and is the thing the fixer rebasing this branch should resolve alongside the v5 conflicts.
Carried-over finding (medium) — hive-authored bypass dropped, unstated. src/pkg/dashboard/rebase_merge_followthrough.go:65 changes if !hiveAuthored && !st.PushReachable() to if !st.PushReachable(). On v5 a hive-authored PR whose head is in a fork without maintainer_can_modify was still armed (the hive owns that branch and can push to it); after this change it is refused at arm time with head-not-pushable. The body says ordinary fork rebases keep their behaviour, and neither new dashboard test exercises IsHiveAuthorLogin(st.Author)==true with FromFork && !MaintainerCanModify. The narrow fix that keeps the workflow fence is:
if len(st.WorkflowPushPaths) > 0 || (!hiveAuthored && !st.PushReachable()) {Everything else I re-checked holds: PushReachable() at src/pkg/github/pr_merge_state.go:57 now folds in WorkflowPushPaths, both compare directions plus renames are covered by pr_merge_state_workflow_test.go, and the ticker path fails an existing follow-through on drift without failing closed on a compare error.
Queue note for a maintainer: #15307 and #15583 cannot both merge. Since the fixer is working this branch, #15307 is the one to close as superseded once this lands. I have not closed anything.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
Check both sides of a maintainer-editable fork rebase before arming a fixer push. Report workflow push failures with a human recovery step, and stop live follow-throughs when workflow drift makes their push unavailable. Hive-Run: #15133 Hive-Plan: workflow-fork-rebase-preflight Hive-Spec: issue-15133#workflow-push-reachability Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
a46bcae to
8bc2b42
Compare
|
hive/awaiting-ci: rebased onto v5 (resolved test-fixture conflict in api_repo_item_decision_test.go, original commit and sign-off preserved). CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
Conclusion: this is #15307's head replayed onto v5 (same 7 files, +219/−8); the rebase is clean, but the one finding from the review of #15307a46bcae is carried over unchanged, so it still applies at 8bc2b42.
Re-verified on this head:
src/pkg/github/pr_merge_state.go:85-100—WorkflowPushPathsis computed only whenopen && FromFork && MaintainerCanModify && NeedsRebase(); both compare directions plusGetPreviousFilename()(:175-179) are covered. The fence itself is correct.src/pkg/dashboard/rebase_merge_followthrough.go:237-243— ticker fails an existing follow-through on workflow drift and settles the ledger; compare errors are logged and skipped upstream intickRebaseMerge, so a transient API failure cannot fail closed.
Still open (medium) — hive-authored arm-time bypass dropped, unstated:
src/pkg/dashboard/rebase_merge_followthrough.go:65 is if !st.PushReachable() {; v5 has if !hiveAuthored && !st.PushReachable() {. hiveAuthored is still computed at :64 and used at :87 and :104, so only the arm-time bypass went away. A hive-authored PR whose head is in a fork without maintainer edits never reaches the workflow branch (WorkflowPushPaths needs MaintainerCanModify), so it now falls to FailNotReachable and is refused before the approval is recorded — where v5 armed and rebased it. Neither new test runs IsHiveAuthorLogin(st.Author) == true with FromFork && !MaintainerCanModify.
Smallest fix that keeps the workflow fence and the existing behaviour the body promises ("ordinary fork rebases … retain their existing behavior"):
if len(st.WorkflowPushPaths) > 0 || (!hiveAuthored && !st.PushReachable()) {If dropping the bypass is intended, a one-line note in the body and a test covering that pair would settle it. Not blocking from my side; flagging so the fixer on this branch addresses the review ask and not only the conflicts.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Conclusion: the workflow-path fence looks correct to me; one behaviour change carried over from #15307 is still unstated and untested, but I now think it is the right direction rather than a regression.
What I verified (read v5 tree + callers at 8bc2b42):
- This head is #15307's
a46bcaecontent unchanged; the only delta against it is rebase churn (driveRebaseMergehotspotObserveConflictblock fromv5, test-mock additions from other merged PRs). So the earlier review on #15307 applies here as-is. src/pkg/github/pr_merge_state.go:85-101:WorkflowPushPathsis only computed foropen && FromFork && MaintainerCanModify && NeedsRebase(), so same-repo PRs and non-rebasing forks never get the extra compare calls andPushReachable()(:56-58) is unchanged for them. Both compare directions plusGetPreviousFilename()(:175-179) catch a renamed workflow on either side.compareFilesis already used with the same base-repo/fork-SHA pattern at:148-152.rebase_merge_followthrough.go:221-227: a compare error fromGetPRMergeStateis logged and the tick continues, so a transient API failure cannot fail an armed follow-through closed.:237-243settles the ledger and invalidates the tracker on workflow drift.rebasemerge.go:207-210clears the adopt-fresh/close options forFailWorkflowPush, matching theNexttext atrebase_merge_followthrough.go:139-141.
Finding (low) — !hiveAuthored bypass dropped, not in body or changelog:
rebase_merge_followthrough.go:65 goes from if !hiveAuthored && !st.PushReachable() to if !st.PushReachable(). Effect: a hive-authored PR whose head is in a fork without maintainer edits is now refused head-not-pushable at arm time instead of being armed and sent to update-branch. Per src/docs/operator-reference.md:248, update-branch on a hive-authored fork head already requires "allow edits by maintainers", so the old bypass would have armed a follow-through that could not complete — the new behaviour is the honest one. But the body says "Ordinary fork rebases and same-repository rebases retain their existing behavior", and TestRebaseMergeWorkflowForkRefusesBeforeArming only covers maintainer_can_modify: true + workflow path. Suggest: one sentence in the PR body / changelog fragment naming this, and a test case for hive-authored fork + maintainer_can_modify: false + no workflow path expecting head-not-pushable so the change is pinned rather than incidental.
Not blocking on my side; the fixer working this branch can fold it in.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
Only workflow paths refuse every author at arm time; a hive-authored fork head without maintainer edits still arms as on v5, since the hive pushes its own heads with its own credentials. Adds a test for both sides. Hive-Fix-Attempt: 1/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Read the fence, the arm path, the tick, and the callers. The workflow-path refusal itself looks correct to me: PRMergeState.WorkflowPushPaths is only computed for open fork PRs with maintainer-edit that need a rebase (pr_merge_state.go:85), both compare directions mirror PRConflictCandidates, PreviousFilename catches renamed workflows, and armRebaseThenMerge checks workflow paths before the hive-authored reachability bypass so the App's own forks are fenced too.
One low-severity consequence of the deliberate fail-closed choice, for the maintainer to weigh:
pr_merge_state.go:92returns an error fromGetPRMergeStatewhen either compare fails. The only caller that previously could not see a compare error isapi_repo_item_decision.go:599, which treatserr != nilas "does not need rebase" and falls through: it posts the merge note at:610, thenMergePRViaat:616gets GitHub's 405 on a dirty/behind head and the operator sees a 502. Before this change a transient/comparefailure on that path did not exist; after it, a flaky compare on a fork+needs-rebase PR produces a stray "merging" comment and an opaque error instead of the rebase-then-merge arm or the new refusal. Consider making the arm path distinguish "merge state unreadable" from "does not need rebase", or leaving the fence best-effort there. Not a blocker.
The tick path (rebase_merge_followthrough.go:227) already logs and skips on error, so in-flight follow-throughs are unaffected.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read this head against v5 (and against #15307's head a46bcae, which it adopts): the fixer's commit 956fdb1 restores the one thing the swarm flagged on #15307, and the fence itself still reads correct to me.
What changed since #15307's reviewed head. src/pkg/dashboard/rebase_merge_followthrough.go:65-77 now refuses in two distinct cases: len(st.WorkflowPushPaths) > 0 → FailWorkflowPush for every author, and !hiveAuthored && !st.PushReachable() → FailNotReachable. So a hive-authored head in a fork without maintainer edits arms exactly as on v5 (the dropped bypass was the medium finding on #15307), and TestRebaseMergeForkWithoutMaintainerEditsKeepsHiveAuthoredBypass (rebase_merge_followthrough_test.go:400) covers it. FailNow(now, refusal, st.WorkflowPushPaths) passes an empty slice in the not-reachable branch, equivalent to the old nil.
Verified unchanged from the earlier read. pr_merge_state.go:85-101 computes WorkflowPushPaths only for open fork PRs with maintainer edits that need a rebase, checking both compare directions; PushReachable() at :56-58 folds the paths in; the ticker path driveRebaseMerge at rebase_merge_followthrough.go:239-245 fails an existing follow-through on workflow drift for every author. go build is clean on the dashboard/github packages.
One gap worth knowing, low, not a regression. Because WorkflowPushPaths is only computed when st.MaintainerCanModify (pr_merge_state.go:85), a hive-authored fork head without maintainer edits that carries workflow drift takes the restored bypass and arms, then fails at push time — exactly the timeout the fence is meant to avoid, and the comment at :65-67 ("Workflow paths refuse every author") overstates coverage for that case. v5 armed it too, so nothing gets worse here; if you want the fence complete, computing the paths for FromFork && NeedsRebase() regardless of MaintainerCanModify closes it at the cost of two compare calls per fork rebase. Fine as a follow-up.
For the maintainer: this is the hive's adoption copy of #15307 (same Fixes #15133, original commits preserved, plus the fix above). #15307 is dirty against v5; once this lands it should close as superseded. I have not closed anything.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Supersedes #15307 (adopted after CI went red and the contributor was unavailable; original commits by @thatguywob preserved).
Fixes #15133
This branch is #15307's head
a46bcae867d2as pushed by @thatguywob (forkthatguywob/hive), unchanged. Last lane reason on the original:adoption-stalled:supersede-failed:conflicting.Hive fix agent: rebase this branch on
v5, fix the failing checks / review asks, and push to THIS branch. Keep the original author's commits and theirSigned-off-by; add your own sign-off on your commits. Do not open another PR.Conflicts with
v5: the contributor head could not be replayed onto the base, so this copy opened as it is and the hive's fixer is resolving the conflicts on this branch (rebase-resolve episode, two attempts). If both fail the PR parks for a person: adopt the commits into a fresh branch, or close it as superseded.Behavior note (review fix 1/6): at arm time, only fork heads with workflow changes on either side of the rebase are refused, for every author. A contributor fork without maintainer edits is still refused as unreachable, and a hive-authored fork head without maintainer edits still arms as on v5 (the hive pushes its own heads). Same-repository rebases are unchanged.