Skip to content

🐛 fix: refuse workflow-changing fork rebase follow-through - #15583

Merged
hivecommons-hive[bot] merged 2 commits into
v5from
hive/adopt-15307
Oct 30, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
v5from
hive/adopt-15307

Conversation

@hivecommons-hive

@hivecommons-hive hivecommons-hive Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

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 a46bcae867d2 as pushed by @thatguywob (fork thatguywob/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 their Signed-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.

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 30, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kellyaa for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 30, 2026
@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) labels Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#15405 🐛 fix: require verified signature for email-only hive commit identity match CONFLICT src/pkg/dashboard/rebase_merge_followthrough_test.go
#15307 🐛 fix: refuse workflow-changing fork rebase follow-through same files changelog.d/fixed-15133-workflow-fork-rebase.md
src/pkg/dashboard/api_repo_item_decision_test.go
src/pkg/dashboard/rebase_merge_followthrough.go
src/pkg/dashboard/rebase_merge_followthrough_test.go
src/pkg/github/pr_merge_state.go
src/pkg/github/pr_merge_state_workflow_test.go
src/pkg/rebasemerge/rebasemerge.go

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@kubestellar-prow kubestellar-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

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: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 8bc2b4269

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 30, 2026
@hivecommons-hive hivecommons-hive Bot added stage/080-awaiting-merge-admission CI green, verdict approve, no modifiers; the automerge lane has not admitted it yet and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Oct 30, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 — WorkflowPushPaths is computed only when open && FromFork && MaintainerCanModify && NeedsRebase(); both compare directions plus GetPreviousFilename() (: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 in tickRebaseMerge, 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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 a46bcae content unchanged; the only delta against it is rebase churn (driveRebaseMerge hotspot ObserveConflict block from v5, 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: WorkflowPushPaths is only computed for open && FromFork && MaintainerCanModify && NeedsRebase(), so same-repo PRs and non-rebasing forks never get the extra compare calls and PushReachable() (:56-58) is unchanged for them. Both compare directions plus GetPreviousFilename() (:175-179) catch a renamed workflow on either side. compareFiles is already used with the same base-repo/fork-SHA pattern at :148-152.
  • rebase_merge_followthrough.go:221-227: a compare error from GetPRMergeState is logged and the tick continues, so a transient API failure cannot fail an armed follow-through closed. :237-243 settles the ledger and invalidates the tracker on workflow drift.
  • rebasemerge.go:207-210 clears the adopt-fresh/close options for FailWorkflowPush, matching the Next text at rebase_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>

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:92 returns an error from GetPRMergeState when either compare fails. The only caller that previously could not see a compare error is api_repo_item_decision.go:599, which treats err != nil as "does not need rebase" and falls through: it posts the merge note at :610, then MergePRVia at :616 gets GitHub's 405 on a dirty/behind head and the operator sees a 502. Before this change a transient /compare failure 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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@hivecommons-hive
hivecommons-hive Bot merged commit 5142fd3 into v5 Oct 30, 2026
73 of 75 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the hive/adopt-15307 branch October 30, 2026 01:22
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#15583956fdb1` sha256:0fdece41e344813f2b4b722567341973f46f62eb1712eb296178b6a89585a9b8 — download from the dashboard or `hivectl review evidence #15583`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR conflicts-with-open-pr Open PR has a merge conflict with another open PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/L Denotes a PR that changes 100-499 lines, ignoring generated files. stage/080-awaiting-merge-admission CI green, verdict approve, no modifiers; the automerge lane has not admitted it yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review backlog (security): Armed follow-through routes workflow-path fork PRs to a fixer push the App token cannot complete

1 participant