Repository navigation
π merge train: ready PRs lead; odometer rolls only after the bee lands - #15763
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
|
|
@clubanderson this PR is held at Failing checks:
Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path. |
|
stage 080-awaiting-merge-admission β 071-needs-author: required-check-failing:build-and-test |
There was a problem hiding this comment.
The Go side reads correctly; the red build-and-test is the PR's own and is a two-line fix in the Node harness.
Why CI is red (Dashboard helper tests, 2 failures) β both in src/pkg/dashboard/stage_tracker_overlap_hint.test.js, which this PR does not touch
not ok 76 β¦ ReferenceError: STAGE_TRACKER_OVERLAP_CHIP_LEAD is not defined. The harness stitches named functions out ofstatic/index.htmlplus a hand-maintained list of consts (stage_tracker_overlap_hint.test.js:21-25).stageTrackerOverlapBadgeTextnow references the newSTAGE_TRACKER_OVERLAP_CHIP_LEAD(tracker-words-core.js:446, used at:462-463), but the const is not in that list. The Go-side harness got it βstage_tracker_merge_train_overlap_test.go:254adds it viajsConstLineβ the Node one did not. Add"const STAGE_TRACKER_OVERLAP_CHIP_LEAD = 'train Β· ';"to thesrcarray.not ok 77 β¦expects'overlaps #7 (a.go) β will queue behind it'atstage_tracker_overlap_hint.test.js:74;stageTrackerOverlapTipnow emits'β¦ β joins the merge train behind it when green'(tracker-words-core.js:473, mirroring Go'sstageTrackerOverlapJoinsNote). Update the expectation.
Verified against the tree at ef944c9
groupMergeTrains(automerge_merge_train.go:311-316): readiness rank sits afterBlockedand beforemergeable_state, so a blocked head still never fronts, and a ready head now leads an unknown one, which leads an unready one. Matches the stated root cause.noteMergeTrainOutcome(:927-943) now stores ready/unready verdicts, not just blocked/human. I checked every reader:mergeTrainHeadBlocked(:957-959) andmergeTrainHeadHumanMerge(:991-993) testv.blocked/v.humanMergeexplicitly rather than mere presence, and the only other consumer (automerge_merge_train_duplicate.go:129) goes throughmergeTrainHeadBlocked. No reader still treats "stored β blocked".mergeTrainReadinessOf(:888-899):""(merge attempted) / soaking /MergeQueueReasonβ ready; CI pending / no-verdict / review-gate awaiting β unready; everything else unknown, which deletes the mark exactly as before for handoffs. A parkedmerge-train:β¦reason therefore reads unknown andmergeTrainHeadReadiness(:968-986) also returns unknown for a parked stage record β the doc comment says so, and it is harmless (parked members are behind a ready front by construction).stageengine.MergeQueueReasonis a pure extraction of the existingClassifyStagecondition (derive_pr_classify.go:306-308,:500);automergealready importedstageengine, so no new cycle.- Post-pass
stageTrackerOverlapJoinBehind(stage_tracker_merge_train_postpass.go:124-135) picks the lowest plannerPositionamong riders and re-points below-queue hints at it;front == it.Numberis guarded (overlap.go:72). - Odometer:
stageTrackerMergingHoldMaskdoes returnheld(tracker-merged.js:161), and_stageTrackerMergedHeldis folded into bothstageTrackerMergedHoldbackandstageTrackerMergedInFlight(:421-428,:590), so the count defers until the masked merge becomes a flight. I could not exercise the SPA; this is a read, not a run.
Once the two test lines are fixed this looks correct to me.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Go side looks correct to me (I read automerge_merge_train.go, derive_pr_classify.go and the two dashboard post-pass files at e4572a7; I did not review the tracker-merged.js / tracker-words-core.js odometer change beyond its tests).
What I checked:
noteMergeTrainOutcome(src/pkg/github/automerge/automerge_merge_train.go:928β942) now also stores ready / unready verdicts, not just blocking/human-merge ones. Every reader ofmergeTrainVerdictswas updated to test the specific field rather than presence:mergeTrainHeadBlocked:958(v.blocked || v.humanMerge),mergeTrainHeadReadiness:969,mergeTrainHeadHumanMerge:992(v.humanMerge). So a ready verdict can no longer be misread as "blocked".- Sort order in
groupMergeTrains(:311β316) is Blocked β readiness rank β mergeable-state rank, which is the stated fix: a green 080 member fronts a CI/Review member of the same train. stageengine.MergeQueueReasonis a pure extraction of the existing predicate (derive_pr_classify.go:306β308, call site:500), andstageenginedoes not importautomerge, so no cycle.stage_tracker_merge_train_postpass.go:127β137re-points below-queue hints at the lowest-Position rider viastageTrackerOverlapJoinBehind, which preservestrainID/position.
No findings.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
@clubanderson this PR is held at Why:
Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path. |
|
stage 080-awaiting-merge-admission β 071-needs-author: conflicting |
β¦y front The lane's train planner ordered members by GitHub mergeable state, age and number, never by hive's own readiness, so a PR still at 050 CI/Review could front a train and hold fully green 080 members behind it (owner: "if 15471 is in ci/review, how can it be first in a train?"). - automerge: members carry a readiness tier (ready / unknown / unready) learned from the lane's last verdict or the stage store; the sort puts ready members first, then unknown, then unready, before the existing mergeable-state / age / number tiebreaks. Re-sorted every pass. - dashboard: a below-queue member's overlap hint points at the riding (ready) front; the chip reads 'train Β· joins behind #N when green' in the member's real column, never a Merge-queue chip. An all-unready train says it is provisional. - docs: hive-merge.md 'Merge train: ready PRs lead'; operator-reference. - tests: ordering table cases, readiness memory, column placement, chip wording under node. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
The merge-gate hold (#15245) masks a landed merge as still 'Merging' for the banner's lifetime, and the bee only launches when the hold ends. The Merged chip, though, held its number back only for merges with a glyph pending or in flight β so the poll that brought the merge (and the server's raised all_time) rolled the drum at once, thirty seconds before the bee flew, and the landing found nothing left to roll. Masked merges are now tracked (_stageTrackerMergedHeld) and treated as flights to come: the holdback subtracts them from the shown count and the drum (and day/week line) stays still while any is held. The number rolls once, on the landing; successive merges each wait for their own bee; the final displayed value equals the server's; a reload shows the server's number immediately. Node test runs the real hold functions, which the other celebration tests stub off β the path was uncovered. Fixes #15762 Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
e4572a7 to
939172d
Compare
|
hive/awaiting-ci: rebased onto v5 (e4572a7β939172d), conflicts in src/pkg/stageengine/derive_pr_classify.go resolved keeping both sides (v5's native merge-queue reason prefix folded into the new π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
|
@clubanderson this PR is back in your court (
Once the new head lands, CI and the review swarm re-run automatically and the PR returns to the normal path. |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Closes #15761, closes #15762
Two owner-reported stage-tracker / merge UX bugs, one commit each.
π Merge train: ready PRs lead (#15761)
Root cause.
groupMergeTrainsordered members by Blocked β GitHubmergeable_stateβ age β number. Hive's own readiness was never a key, so the oldest overlapping PR fronted the train even while still at 050 CI/Review, and green 080 members waited behind it (live: train 1st:#15741 at 050 holding #15748/#15755 at 080).Fix (lane,
pkg/github/automerge). Members carry a readiness tier β ready (080 admitted / soaking / merge-queue reason), unknown (never evaluated), unready (CI pending, no verdict, review gate) β learned from the lane's last verdict for that head SHA or, failing that, the stage store. The sort is now Blocked last β readiness β mergeable state β age β number, re-run every pass, so a member going green moves up and one going red moves back. A train with no ready member has a provisional front. After the ready front mergesmergeTrainAfterFrontMergestill refreshes the others' base (require_current_base) and the next pass re-sorts.Fix (dashboard). A below-queue member's overlap hint points at the riding front (the one the lane will actually merge first) and renders in its real column as
train Β· joins behind #N when green; only 080/095 members get Merge-queue chips. Header staysmerge train Β· N PRs Β· 1st: #<ready front>. An all-unready train says so plainly.Tests: ordering table cases (ready-before-unready, unknown between, all-unready age tiebreak, blocked trails), readiness memory, column placement for the live scenario, chip wording under node. Docs:
hive-merge.md"Merge train: ready PRs lead", operator-reference row.π Odometer rolls only after the bee lands (#15762)
Root cause. The merge-gate hold (#15245) masks a landed merge as still "Merging" for the banner's lifetime (30 s); the bee launches only when the hold ends. The Merged chip held its number back only for merges with a glyph pending or in flight (#15568). The poll that reports the merge also brings the server's raised
merged.all_timeβ during the hold nothing is pending,stageTrackerMergedInFlight()is false, andstageTrackerMergedCountDrawrolled the drum to the new total immediately. Thirty seconds later the bee landed andstageTrackerCelebrateTickhad nothing left to roll.Fix. Masked merges are tracked (
_stageTrackerMergedHeld) and treated as flights to come:stageTrackerMergedHoldbacksubtracts them from the shown count andstageTrackerMergedInFlightkeeps the drum and the day/week line still while any is held. The number rolls once, on the landing (animationend; fallback timer when the glyph exits off-screen; after the fade under reduced motion). Successive merges each wait for their own bee; the final displayed value equals the server's; a reload shows the server's number at once.Test:
TestStageTrackerOdometerWaitsForMergingHoldNoderuns the SPA under node with the real hold functions (the other celebration tests stub them off, which is why this path was uncovered). Verified it fails on the old code at "the total waits for the bee (it used to roll here, a full hold early)".Validation
go vet+go test ./pkg/dashboard/... ./pkg/github/automerge/... ./pkg/stageengine/...green, including the webstatic style ratchet andTestIndexHTMLIsGenerated(static-src edited, index.html regenerated). No newtime.Sleepin tests. Changelog fragments:changelog.d/fixed-merge-train-readiness-order.md,changelog.d/fixed-odometer-rolls-after-bee-lands.md.