Repository navigation
✨ Conflict-aware merge train in the automerge lanes - #15157
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
|
|
This PR also implements the post-front sibling-repair scope of #15143, including the contributor lane requested in that issue: Two acceptance details to finish here rather than in a competing train implementation:
— hive: backend=codex 🐝 Hive Agent: |
174910c to
36b2755
Compare
|
@clubanderson is auto-promoted for contributor-lane merging on this PR: the last 5 merged PRs by this author in this hive's repositories have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply. |
Approved PRs to one base whose changed files overlap are grouped per
sweep; one front merges at a time, siblings wait at stage/080 as
merge_gate.state=queued-behind (never a human stage). After the front
merges the lane updates behind branches and asks the rebase-resolve hook
for dirty ones, bounded by auto_merge.merge_train.max_rebase_attempts
(default 2); past it the PR goes to stage/085 with the option
"Rebase, then merge as maintainer".
The Activity Monitor renders a train contiguously with a left rail and
a header chip, pills "Merging · front of train", "In merge train · 3rd
of 4", "Rebasing · attempt 1/2", "Needs human decision · rebase failed
twice"; tooltips list PRs ahead and overlapping files; items carry
merge_train{id,state,front,position,size,overlap_files,ahead}.
Fixes #15117
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
9919d2d to
26bfd3f
Compare
|
Needs a decision, not a merge:
Head: verdict requires_human @26bfd3f, 65/66 checks green, 1 pending, DCO yes, soak 0s of 30m0s. How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
…e; the exhausted row's rebase-then-merge option goes live v5 landed the conflict-aware merge train (#15157) with a RebaseResolver hook reserved for this PR and a duplicate rebaseMergeFollowThroughLabel. The hook now opens the shared rebase episode (requested_by: merge-train); the mergeNowWired flag and its disabled reason go, since the option it guarded is wired here. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
…e; the exhausted row's rebase-then-merge option goes live v5 landed the conflict-aware merge train (#15157) with a RebaseResolver hook reserved for this PR and a duplicate rebaseMergeFollowThroughLabel. The hook now opens the shared rebase episode (requested_by: merge-train); the mergeNowWired flag and its disabled reason go, since the option it guarded is wired here. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
…e; the exhausted row's rebase-then-merge option goes live v5 landed the conflict-aware merge train (#15157) with a RebaseResolver hook reserved for this PR and a duplicate rebaseMergeFollowThroughLabel. The hook now opens the shared rebase episode (requested_by: merge-train); the mergeNowWired flag and its disabled reason go, since the option it guarded is wired here. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
…e; the exhausted row's rebase-then-merge option goes live v5 landed the conflict-aware merge train (#15157) with a RebaseResolver hook reserved for this PR and a duplicate rebaseMergeFollowThroughLabel. The hook now opens the shared rebase episode (requested_by: merge-train); the mergeNowWired flag and its disabled reason go, since the option it guarded is wired here. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
…e; the exhausted row's rebase-then-merge option goes live v5 landed the conflict-aware merge train (#15157) with a RebaseResolver hook reserved for this PR and a duplicate rebaseMergeFollowThroughLabel. The hook now opens the shared rebase episode (requested_by: merge-train); the mergeNowWired flag and its disabled reason go, since the option it guarded is wired here. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
…e; the exhausted row's rebase-then-merge option goes live v5 landed the conflict-aware merge train (#15157) with a RebaseResolver hook reserved for this PR and a duplicate rebaseMergeFollowThroughLabel. The hook now opens the shared rebase episode (requested_by: merge-train); the mergeNowWired flag and its disabled reason go, since the option it guarded is wired here. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
…e; the exhausted row's rebase-then-merge option goes live v5 landed the conflict-aware merge train (#15157) with a RebaseResolver hook reserved for this PR and a duplicate rebaseMergeFollowThroughLabel. The hook now opens the shared rebase episode (requested_by: merge-train); the mergeNowWired flag and its disabled reason go, since the option it guarded is wired here. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
…e; the exhausted row's rebase-then-merge option goes live v5 landed the conflict-aware merge train (#15157) with a RebaseResolver hook reserved for this PR and a duplicate rebaseMergeFollowThroughLabel. The hook now opens the shared rebase episode (requested_by: merge-train); the mergeNowWired flag and its disabled reason go, since the option it guarded is wired here. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
…e; the exhausted row's rebase-then-merge option goes live v5 landed the conflict-aware merge train (#15157) with a RebaseResolver hook reserved for this PR and a duplicate rebaseMergeFollowThroughLabel. The hook now opens the shared rebase episode (requested_by: merge-train); the mergeNowWired flag and its disabled reason go, since the option it guarded is wired here. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
…ed conflicting PRs; dismiss self-inflicted changes_requested (#15104) * 🐛 Activity Monitor: Rebase, then merge as maintainer; autonomous rebase-resolve with loop guard; approve on a dirty PR queues the rebase; dismiss self-inflicted changes_requested Squashed and rebased onto v5 after #15087 and #15074 landed. Fixes #15103 Signed-off-by: Andrew Anderson <andy@clubanderson.com> * test: fix fixtures after the v5 rebase (mock fields, failingEntry rebase fields, import ratchet, window shim) Signed-off-by: Andrew Anderson <andy@clubanderson.com> * test: lift pkg/rebasemerge coverage above its floor; drop an ineffectual assignment Signed-off-by: Andrew Anderson <andy@clubanderson.com> * test: compare the shared singletons through named values (staticcheck SA4000) Signed-off-by: Andrew Anderson <andy@clubanderson.com> * security: rebase-then-merge fails closed on a head the hive did not produce; document the new API shapes The approval is bound to the head the operator read. A contributor PR whose head moves after the click now counts as rebased only when GitHub reports the hive (App bot or pane identity) as the commit's author or committer; any other head settles the follow-through as failed (foreign-head) with nothing merged, a note on the PR, and 'Approve the new head & merge' as the way out. api-reference.md gains the 202 rebase-queued answer, the rebase response field, and the rebase_merge / rebase row fields. Signed-off-by: Andrew Anderson <andy@clubanderson.com> * merge train: hand a dirty member to the fixer's rebase-resolve episode; the exhausted row's rebase-then-merge option goes live v5 landed the conflict-aware merge train (#15157) with a RebaseResolver hook reserved for this PR and a duplicate rebaseMergeFollowThroughLabel. The hook now opens the shared rebase episode (requested_by: merge-train); the mergeNowWired flag and its disabled reason go, since the option it guarded is wired here. Signed-off-by: Andrew Anderson <andy@clubanderson.com> * test: approve toast wording follows #15213 Signed-off-by: Andrew Anderson <andy@clubanderson.com> * rebase onto v5: drop duplicate nonEmptyString, lift STAGE_TRACKER_ICONS for the history badge in the rebase-then-merge row test Signed-off-by: Andrew Anderson <andy@clubanderson.com> * writeback ratchet: baseline the two operator-solicited comments of the rebase-then-merge follow-through Signed-off-by: Andrew Anderson <andy@clubanderson.com> * automerge: superseded question precedes the label block (#15278) while a needs-rebase label on a merely-behind head stays stale Signed-off-by: Andrew Anderson <andy@clubanderson.com> --------- Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Fixes #15117
Fixes #15141
Fixes #15143
Fixes #15144
Problem
Today on hive's own hosted spoke six approved PRs to v5 (#15070 #15072 #15074 #15085 #15087 #15097) all touched
stage_tracker.goandindex.html. The moment one merged the rest wentmergeable_state=dirty; the automerge sweep loggedautomerge skip reason=conflicting/label:needs-rebaseevery cycle and nothing ordered or repaired them. A human serialized them by hand.What this does
Engine (
pkg/github/automerge/automerge_merge_train.go, all three lanes: hive, trusted-author, contributor)GET /pulls/{n}/files, cached by head SHA; union-find grouping).merge-train:queued-behind#<front>:<pos>/<size>:....behind->PUT update-branch;dirty->RebaseResolverhook (RebaseRequest). Loop guard:auto_merge.merge_train.max_rebase_attempts(default 2) per PR per front; past it the PR carriesrebase-exhaustedand lands at stage/085.merge trainline per order change, not per cycle.auto_merge.merge_train.enabled(default true),auto_merge.merge_train.max_rebase_attempts(2).Tracker (
pkg/dashboard)merge_gate.state=queued-behindwith reasonbehind #15074 in merge train (3rd of 4, overlapping files: stage_tracker.go, index.html);merge_train{id,state,front,position,size,attempt,max_attempts,overlap_files,ahead}on items and linked PRs. Waiting siblings are never a human stage, never red; aneeds-rebaselabel on one is reported understale_labels.⛓ merge train · 4 PRs · front #15074; pills "Merging · front of train", "In merge train · 3rd of 4", "Rebasing · attempt 1/2", "Needs human decision · rebase failed twice" (option "Rebase, then merge as maintainer"); tooltip lists PRs ahead + overlapping files.Coordination with #15104
#15104 (
fix/rebase-then-merge) is not on v5 yet, so this PR defines theRebaseResolver/RebaseRequesthook in automerge with a TODO at thecmd/hivewiring; a dirty PR with no resolver falls through to the existingconflictingpath (logged once). The "Rebase, then merge as maintainer" option is offered disabled with an honest reason until #15104 lands, since the #15087decide:merge-nowhandler merges a mergeable head only. Expect a small conflict with #15104 instage_tracker_merge_train.go(option wiring); whichever lands second drops the stub.Tests
Table-driven grouping, front selection, post-merge sibling handling (behind -> update-branch, dirty -> resolver), loop guard, transition-log-once, files cache; dashboard Go payload test + node fixture test for rail/header/pill wording/tooltip; stageengine classify; config defaults. No
time.Sleep. Coverage: automerge 89.3%, github 88.8%, dashboard 87.9%, config 90.3%.Docs
src/docs/operator-reference.md(two config rows),src/docs/dashboard-sections.md("Merge train"),changelog.d/added-automerge-merge-train.md.Supersedes #15149
The scanner opened #15149 in parallel for the same issue (front selection only, items 1 + part of 2; self + trusted lanes). This PR covers the whole of #15117 and its three sub-issues:
/filescached by head SHAauto_merge.merge_train.enabled(default true)behind→ update-branch,dirty→ rebase-resolve hook,max_rebase_attemptsloop guard (#15143)merge_gate.state=queued-behind,merge_train{…}on items, pills / rail / header chip / tooltip (#15144)queued-behindreasonNothing else in #15149 is missing here. Sub-issues: #15141 fully covered (Fixes), #15143 fully covered (Fixes; the rebase enqueue is the
RebaseResolverseam for #15104), #15144 fully covered (Fixes; ordinal cases 1st/2nd/3rd/4th/11th/12th/13th/21st are in the node fixture).