Repository navigation
π tracker: show Merging in the merge gate for at least the toast lifetime before β - #15251
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
|
396e188 to
e73be4c
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. |
There was a problem hiding this comment.
Correctness review (read at head e73be4c β the PR moved on from 396e188 while this was dispatched).
The hold logic itself checks out: traced stageTrackerMergingHoldNext/Mask/Release through stageTrackerNoteMerges (index.html:18979-19118) against stageTrackerCarryOpen/stageTrackerNewlyMerged (18966-18977); no second hold after expiry, re-read on release is fresh exactly once, and every merge path is bracketed (pullrequest.go:474-497, automerge_sweep.go:3066-3080, all three executeMergeEffect call sites). Two non-blocking notes:
-
Merged chip bumps during the hold, not at its end (body: "When the hold ends the merge is re-read as fresh β β, banner, glyph flight, chip bump"). While a PR is held,
stageTrackerMergedSyncstill runs each poll with the merge already ind.merged.recent/all_time, andstageTrackerMergedHoldback(_stageTrackerMerged, _stageTrackerCelebratePending)(stageTrackerMergedCountDraw) only subtracts keys in_stageTrackerCelebratePendingβ the held merge isn't fresh yet, so it isn't pending, so the count rises up to 30 s before the row's β/glyph flight. Pre-PR the holdback worked because fresh-detection and the server count rose in the same poll. Fix: treat live holds as holdback too:const holdback = Object.assign({}, _stageTrackerCelebratePending); for (const k of Object.keys(_stageTrackerMergingHold || {})) if (stageTrackerMergingHoldLive(_stageTrackerMergingHold[k], now)) holdback[k] = true; const txt = stageTrackerMergedText(_stageTrackerMerged, now, stageTrackerMergedHoldback(_stageTrackerMerged, holdback));(replacing the
const txt = β¦line instageTrackerMergedCountDraw).stageTrackerMergedHoldbackalready ignores keys not inserver.recent, so an in-flight hold on a still-open PR costs nothing. -
Low:
stageTrackerMergingHoldNextseedssincefrom servermerging_since(index.html:19053) but tests liveness against browserDate.now(), so a browser clock ahead of the server shortens the β₯30 s dwell (behind lengthens it). The body says "from the first moment it saw Merging"; preferring the client first-sight time β(prev[key] && prev[key].since) || nowMsβ matches that and removes the skew dependency. Same pattern as existingnext_sweep_atcountdowns, so advisory only.
Body nit: "all four automerge call sites" β there are three (automerge_sweep.go:1907, 2302, 2653).
β hive: agent=adjudicator-3 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. |
β¦time before β Fixes #15245 Stage 100 was only derived after a refused merge; a successful merge recorded nothing between the pre-merge stage and merged, so a PR went from 060/090/095 to β within one 30 s poll and "Merging" never showed. Backend: pkg/github/merge_attempts.go registers every merge attempt (MergePRVia β dashboard/relay/forge; executeMergeEffect β all automerge lanes) before the GitHub call and its outcome after; the tracker payload lights the PR at 100 Merging with merge_gate.merging_since/merge_path while the call is in flight or just landed, and merge-failed with the reason when GitHub refused; the tracker cache invalidates on change. SPA: holds Merging per PR for STAGE_TRACKER_MERGING_HOLD_MS (= the merge banner's 30 s) before the row advances to β; merge-failed drops the hold at once with the reason. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
e73be4c to
630991f
Compare
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Fixes #15245
Root cause
Stage 100 (
stagelabels.MergeQueue) was only derived after the fact from refusal reasons inpkg/stageengine/derive_pr_classify.go. A successful merge recorded nothing between the pre-merge stage and merged: the sweep evaluates and callsPullRequests.Mergeinside one pass (executeMergeEffect), the dashboard's Approve & merge goes straight toMergePRVia, and within one 30 s tracker poll the PR simply vanished fromitemsand appeared inrecently_merged. There was nomergingevent or state; the SPA diffed polls to detect "merged" and replayed the row's last HTML (e.g. 060) during the celebration, so Merging never rendered β and nothing held transient gate states for a minimum time.Fix
Backend β
pkg/github/merge_attempts.go: a process-wide registry of merge attempts (Beginbefore the GitHub call,Endwith merged/refused after; finished attempts kept 10 min). Bracketed inMergePRVia(dashboard, relay, forge) andautomerge.executeMergeEffect(all four automerge call sites), so every merge path is covered. The tracker (stage_tracker.go/stage_tracker_merge_gate.go) reads the registry on every build: an in-flight or just-landed attempt lights the PR at 100 Merging withmerge_gate.merging_since+merge_pathand a hive-actor caption; a refusal setsmerge_gate.state: merge-failedwithmerge_failed/merge_failed_atand leaves the stage.server.goinvalidates the tracker cache on every registry change so a poll cannot miss it.SPA β
stageTrackerNoteMergeskeeps a hold per PR from the first moment it saw Merging (or from the poll that reported a surprise merge) and masks the merge as "still open" untilSTAGE_TRACKER_MERGING_HOLD_MS(=STAGE_TRACKER_MERGE_BANNER_MS, 30 s) has passed;renderStageTrackersynthesises the held row at 100 Merging Β· merge landed from its last item. When the hold ends the merge is re-read as fresh β β, banner, glyph flight, chip bump.merge-faileddrops the hold at once and the pill reads Merge failed Β· . Existing ids/classes unchanged.Tests
pkg/github/merge_attempts_test.goβ lifecycle with a fake clock (in flight β merged/refused, retention purge, onChange).pkg/github/automerge/automerge_merge_attempt_test.goβexecuteMergeEffectregisters the attempt before the call and the outcome after (merged / refused / not-applied).pkg/dashboard/stage_tracker_merging_hold_test.goβ Go payload overlay (100 Merging withmerging_since, merge-failed keeps the stage) and a node run of the hold with an explicit clock: masked inside the window, fresh at its end, surprise merge held, satisfied hold not re-held, failure drops it; gate pill words for merging/held/failed.changelog.d/fixed-merging-state-visible.md;check-api-reference-citations.sh --fixrun for theserver.gotouch.