Repository navigation
π tracker: merge-train header counts its rows; human-merge PRs ride no train - #15553
Conversation
β¦o train The Activity Monitor's train header read 'merge train Β· 3 PRs Β· 1st: #15425' over one row: #15529 and #15530 were drawn as sub-rows of their linked issues (nested_under), which the header grouping did not see. An issue row now rides its open PR's train (key, contiguity, rail, merge order), the header counts the rows drawn under it and names members the view hides, and the payload carries merge_train.members. #15425 fronted that train although it waits for a maintainer (untrusted author): the lane's admission verdicts were not blocking for the planner. A head whose last lane verdict maps to a human_merge_reason other than the catch-all policy is now no train member at all; verdicts are keyed per lane so another lane's opinion never evicts a member. Signed-off-by: Andrew Anderson <andy@clubanderson.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
|
There was a problem hiding this comment.
One verified defect in the planner predicate; the SPA/payload side reads correctly to me.
mergeTrainHumanMergeReason (new, src/pkg/github/automerge/automerge_merge_train.go) treats every prstage.HumanMergeReason code except policy as "no train member at all". But HumanMergeReason is not a 090-only mapping β one of its cases catches a transient review-pending state:
src/pkg/stageengine/prstage/reasons.go:147βstrings.HasPrefix(base, AutoMergeReasonReviewGatePrefix)βHumanMergeReasonBranchProtection. That prefix is"review-gate:"(reasons.go:35).src/pkg/stageengine/derive_pr_classify.go:529-530βreview-gate:awaiting-review-approvalandreview-gate:no-review-bundleare classified 060 review-pending, not 090; the comment there says exactly why ("the OWNERS PRs of 2026-10-20 sat unlabelled through the whole review wait").src/pkg/github/automerge/automerge_sweep.go:1980-1981βtrySweepSelfAuthoredPRreturns thatreview-gate:<outcome>string as the sweep skip reason, andautomerge_sweep.go:1226(this diff) hands it tonoteMergeTrainOutcome(stageLaneSelf, β¦); same path for the trusted lane at:2388β:1400.
Mechanism: a self/trusted PR that is simply waiting for the review swarm gets humanMerge: true recorded for its head; on the next planMergeTrains pass it hits the new mergeTrainHeadHumanMerge branch and is skipped as "human-merge". When the verdict lands and the sweep returns a different reason, the entry is deleted and the PR re-enters. Consequence: while awaiting review the PR (a) imposes no ordering on overlapping PRs behind it β the thing the train exists for β and (b) drops out of Members/Ahead, so the header this PR fixes flips from 3 PRs to 2 PRs Β· not in this view: β¦ and back as the swarm catches up. Pre-change, mergeTrainBlockingReason("review-gate:β¦") was false and the PR stayed a member. Severity: medium.
The new table in TestMergeTrainHumanMergeNeverMember does not include a review-gate: reason, so it passes. Adding prstage.AutoMergeReasonReviewGatePrefix + prstage.ReviewGateOutcomeAwaiting: false would fail on this head.
Suggested fix: allow-list the codes that actually mean a person must merge (workflow-files, tests-removed, manual-merge-policy, breaking-change, auto-merge-off, untrusted-author, unauthorized, reviewer-deferred, and branch-protection only when the base reason is merge-refused-review) instead of "anything but policy" β or special-case the review-gate: prefix before calling HumanMergeReason.
Verified OK: the lane strings now in the key match on both sides (planMergeTrains is called with stageLaneSelf / stageLaneTrusted / stageLaneContributor at automerge_sweep.go:1107, :1335, automerge_contributor_lane.go:433, and each sweep notes with the same constant), so per-lane isolation works as the body describes. Members is populated once per train and copied per item, consistent with Ahead.
β 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 |
There was a problem hiding this comment.
Planner side read against v5; one thing worth a look before this lands, the rest looks correct to me. I did not read the SPA (tracker-words.js) changes in depth.
Check: review-gate:awaiting / review-gate:no-bundle now drop a PR from the train entirely. mergeTrainHumanMergeReason (automerge_merge_train.go:840-843) treats every prstage.HumanMergeReason code except policy as "a person merges this". But HumanMergeReason (src/pkg/stageengine/prstage/reasons.go:151) maps every review-gate:* reason to HumanMergeReasonBranchProtection, and an enforcing gate returns review-gate:<outcome> for any non-approved outcome (automerge_review_gate.go:267,284) β including awaiting and no-bundle, which just mean the swarm has not reported on this head yet. So under an enforcing review gate, every freshly pushed self/trusted PR is skipped as human-merge at automerge_merge_train.go:389-392 until its review arrives, and the PRs behind it merge first. That may be what you want (nobody waits on a head that is not moving), but it is the same class as the "soaking, CI pending" verdicts the body and the mergeTrainHumanMergeReason doc comment say stay members, and it is not a case where a human is going to merge β the hive resolves it itself a few sweeps later. If the intent is to keep those as (non-front) members, the predicate needs to exclude awaiting/no-bundle outcomes rather than the whole branch-protection code; if the intent is to drop them, the doc comment and dashboard-sections.md "Who rides" paragraph should say so. requires-human and changes-requested:* outcomes correctly fall on the human side.
What I verified as correct:
- Per-lane keying:
noteMergeTrainOutcomecallers now passstageLaneSelf(automerge_sweep.go:1229),stageLaneTrusted(automerge_sweep.go:1403) andstageLaneContributor(automerge_contributor_lane.go), andplanMergeTrains/planDuplicateHolds/mergeTrainHeadBlockedall read with the lane they plan for, so the trusted lane'suntrusted-author-roleon a PR the contributor lane admits no longer touches the contributor lane's train β the mechanism the body describes. mergeTrainVerdictForstill requiresv.sha == sha, so a new head starts clean, and a non-blocking, non-human verdict still deletes the entry (automerge_merge_train.go:861-864), preserving the old clear-on-success behaviour.Blockedmembers (red check / terminal hold / permanent refusal) keep their old "member but never fronts" semantics; only the human-merge set is new.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
Fixes #15552
The Activity Monitor's train header read merge train Β· 3 PRs Β· 1st: #15425 over one row. Train
v5#15425= #15425, #15529, #15530; the last two were drawn as sub-rows of their issues #15493 / #15523, which the header grouping could not see, and #15425 β waiting for a maintainer (untrusted author) β fronted the train anyway.SPA (
tracker-words.js)stageTrackerRowTrain(item): an issue row rides the merge train of its open linked PR, so key / contiguity / rail / merge order treat it as a member and the train renders all its members together regardless of issue grouping.stageTrackerTrainRowscounts the run it heads;stageTrackerTrainHeaderText(mt, shown)says3 PRsonly when three rows are there, otherwise1 of 3 PRs here Β· 1st: #15425 Β· not in this view: #15529, #15530. No member on the page, no header.merge_train.members(whole roster in merge order) so the hidden ones can be named.Planner (
automerge_merge_train.go)mergeTrainHumanMergeReason, built onprstage.HumanMergeReason: any lane verdict that maps to a human-merge code other than the catch-allpolicy(untrusted author,contributor-lane:no-linked-issue, the title/label human-merge rule, human-merge path, review-refused merge, β¦) makes the PR no train member at all, not just a non-front.noteMergeTrainOutcome(lane, β¦)), so the trusted lane'suntrusted-author-rolefor a PR the contributor lane admits never evicts it from the contributor lane's train.Tests:
TestMergeTrainHumanMergeNeverMember(planner excludes / re-admits, per-lane isolation), node harness: header count == rendered rows, issue rows in the run, hidden members named, no header for an empty run; payload test coversmembers.Docs:
dashboard-sections.mdmerge-train section (header counting, who rides). Changelog fragment included.