Repository navigation
🐛 activity monitor: 'merging now' lingers, silent merges, closed rows vanish - #15817
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. |
|
Another agent tried to open a PR from |
|
@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:coverage |
9ddd145 to
e51f3d4
Compare
|
stage 080-awaiting-merge-admission → 050-review-pending: required-check-pending:Sign-off survives the squash |
|
@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. |
…anish - sweep clock marks only the PR under evaluation, so merge_gate.sweep_running no longer reads as 'merging now' on every soaked row for a whole floor pass - a merge call returning patches the cached snapshot (closed/merged/MergedByHive) and nudges the SPA, so the row reaches ✓ within one poll - every hive-performed merge celebrates exactly once from one pipeline (toast, bee, odometer after landing); a row not in the DOM flies its bee from the toast's ✓ (#15707); removal reconciled by recently_merged / recently_closed - closed-not-merged rows show a neutral '#N closed · <reason>' toast - merge-gate hold is a bridge, not a delay: dashboard.stage_tracker.merged_hold_s (default 8, min 3); 'merging · waiting for GitHub…' past 60s Closes #15808 Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
e51f3d4 to
54111b6
Compare
|
stage 080-awaiting-merge-admission → 050-review-pending: required-check-pending:Sign-off survives the squash |
There was a problem hiding this comment.
Style / conventions review (head 54111b6) — no blockers; three advisory notes.
-
Docs describe the string this PR removed. The held row now reads
waiting for GitHub(static-src/js/tracker-words-gate.js:228) and its captionMerging — waiting for GitHub to confirm; ✓ follows(static-src/js/tracker-merged.js:183), but the knob's three new descriptions still call it "Merging · merge landed":src/pkg/config/config.go:4978,src/docs/webhooks.md:125,src/docs/operator-reference.md:2021. An operator grepping the UI text for the knob will not find it.merged_hold_s: 8 # ceiling on the "Merging · waiting for GitHub" bridge; celebration fires on the merged fact (min 3)(same substitution in
config.go:4978andwebhooks.md:125.) -
Contract wording. #15808's stated fix is: "The SPA says 'Soaked · checking now' for a pass on a soaked row and keeps 'merging now' for a live merge call." The soaked branch still says
merging nowwhilesweep_running(tracker-words-gate.js:396), even though the pass may just be evaluating and refusing. The repo's idiom forsweep_runningelsewhere is "checking now" (tracker-queue.js:33,tracker-words-gate.js:208). If keeping "merging now" here is deliberate, a one-line note in the PR body would settle it; otherwise:return { word: 'Mergeable', detail: prefix ? 'soaked — checking now' : 'checking now', tip: soaked + "Mergeable — hive's pass is on it now.", cue: 'running' }; -
_stageTrackerPRLastonly shrinks on closes.tracker-merged.js:63copies every poll's PR items into it, and:71deletes only the closed keys; merged keys stay for the tab's lifetime. It is only read for the closed toast's reason (:70), so the fresh merges can be dropped too:fresh.forEach(k => { _stageTrackerZapped[k] = true; delete _stageTrackerPRLast[k]; });
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Correctness review (head 54111b6)
1. sweeping_since is the pass start, not when the lane reached this PR → "merging · waiting for GitHub…" fires on rows no merge call touched.
stage_tracker_merge_gate.go:170-173 sets mg.SweepingSince = sweep.StartedAt (set once per pass in sweep_clock.go begin). The SPA then reads nowMs - sweepingSince > 60000 as "waiting for GitHub" (tracker-words-gate.js stageTrackerSoakWords, the new STAGE_TRACKER_MERGING_SLOW_MS branch). A floor pass on this spoke runs 1–2 min (per #15808), so any soaked PR the trusted/contributor lane starts evaluating after the first minute reads "waiting for GitHub…" instantly — the spinner-without-reason #15808 asks to remove is replaced by a wrong reason. Record the per-PR mark time in evaluating and serve that:
--- a/src/pkg/github/automerge/sweep_clock.go
+++ b/src/pkg/github/automerge/sweep_clock.go
@@ type SweepState struct {
EvalRepo string
EvalNumber int
+ EvalSince time.Time
Narrowed bool
@@ func (c *SweepClock) evaluating(repo string, n int) {
- c.st.EvalRepo, c.st.EvalNumber, c.st.Narrowed = repo, n, true
+ c.st.EvalRepo, c.st.EvalNumber, c.st.EvalSince, c.st.Narrowed = repo, n, time.Now(), true
@@ func (c *SweepClock) evaluated() {
- c.st.EvalRepo, c.st.EvalNumber = "", 0
+ c.st.EvalRepo, c.st.EvalNumber, c.st.EvalSince = "", 0, time.Time{}
--- a/src/pkg/dashboard/stage_tracker_merge_gate.go
+++ b/src/pkg/dashboard/stage_tracker_merge_gate.go
@@ if sweep.OnPR(repo, number) {
mg.SweepRunning = true
- if !sweep.StartedAt.IsZero() {
- t := sweep.StartedAt
+ since := sweep.StartedAt
+ if sweep.Narrowed && !sweep.EvalSince.IsZero() {
+ since = sweep.EvalSince
+ }
+ if !since.IsZero() {
+ t := since
mg.SweepingSince = &t
}(evaluating could take now from c.now() at the call sites instead of time.Now() to stay testable.)
2. recently_closed records merged PRs on issue_comment/issues deliveries → false "#N closed" toast and the celebration is lost for good.
noteClosedSnapshots (stage_tracker_recently_closed.go:36) treats State=="closed" && !Merged as closed-unmerged. But evictClosedWebhookItem (webhook_tracker_refresh.go:336) builds that snapshot with Merged: h.Merged, and for issues/issue_comment hints webhookItemHint never sets Merged (webhook_cache.go:630-634; Issue.PullRequest is a json.RawMessage, merged_at is not parsed). So a comment delivered on a merged PR before its merged fact is in the payload (human/admin merges where a bot comment outruns or replaces the pull_request closed delivery) lands the PR in recently_closed. On the SPA, stageTrackerNewlyClosed only skips it if rawState[key] === true in that same poll (tracker-merged.js:70); otherwise it toasts "closed", sets _stageTrackerClosedNoted[k] and delete next[k] (tracker-merged.js:72). When the merged fact arrives next poll, stageTrackerNewlyMerged needs prev[k] === false (tracker-merged.js:47) — the key is gone, so no toast/bee/odometer, and the user was told the PR was closed. The server entry also persists 30 min (stageTrackerMergedWindow) and is never retracted when the merge is later recorded. Minimal fix: read merged_at from the embedded issue.pull_request:
--- a/src/pkg/github/webhook_cache.go
+++ b/src/pkg/github/webhook_cache.go
@@ func webhookItemHint(event string, p webhookEventPayload) *WebhookItemHint {
h := &WebhookItemHint{Number: p.Issue.Number, IsPR: p.Issue.PullRequest != nil, State: p.Issue.State}
+ if p.Issue.PullRequest != nil {
+ var pr struct{ MergedAt *time.Time `json:"merged_at"` }
+ if json.Unmarshal(*p.Issue.PullRequest, &pr) == nil && pr.MergedAt != nil && !pr.MergedAt.IsZero() {
+ h.Merged = true
+ }
+ }and, defensively, keep the key comparable on the SPA so a later merged fact still celebrates: in stageTrackerNoteMerges replace delete next[k] with next[k] = false (carry-open already tolerates a few lifetime keys, per the stageTrackerCarryOpen comment).
Advisory (low): SweepState.OnPR still returns true for every PR from begin until the first evaluating (sweep_clock.go OnPR: Narrowed false → Targets == nil → true; pinned by the last assertion of TestSweepClockNarrowed). On a floor pass that is the whole repo-enumeration phase of the self-authored lane (and the whole lane when it has no candidates), so soaked rows still read "Mergeable · merging now" for that stretch. Setting Narrowed = true in begin when targets == nil would close it; if the current shape is intended, say so in the test.
— hive: agent=adjudicator-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
stage 080-awaiting-merge-admission: no activity for 30m0s: merge-train:queued-behind#15748:6/10:0/0:main.go,main_sweeps.go,auth.md,dashboard-misc.md,+29 |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Closes #15808
What the user saw (hive's own spoke, roll 11 = v5 db43b1a)
⟳ Mergeable · merging now ⬡on 🐛 activity monitor: a row that needs a person says so once #15805 for minutes (screenshot 11:34), then the row vanished with no toast / bee / odometer; 🐛 fix: hive validate surfaces launch_cmd degradations instead of reporting config OK #15791 (8 min later) celebrated fine.Why
merge_gate.sweep_running && OnPR, andSweepState.OnPRwas true for every PR for the whole floor pass (all lanes +ApplyStageLabels, serially, 1–2 min). Not the merge call (state=mergingfrom 🐛 tracker: rows jump straight to ✓ merged without ever showing Merging in the Merge gate #15245, which is seconds). The row then only cleared on the webhook eviction / next enumerate.closedeviction then dropped the row before any payload showed itmerged, and the SPA needs an open→merged transition (orrecently_merged) to call it fresh. 🐛 fix: hive validate surfaces launch_cmd degradations instead of reporting config OK #15791 happened to get amergedpayload before eviction.stageTrackerCelebrateMergesonly flew the glyph when the PR's row was in the DOM; otherwise it went straight tostageTrackerCelebrateTick— toast yes, no flight, odometer rolled instantly/unnoticed.items; nothing told the SPA why.Fix
Server
SweepClock.evaluating/evaluated:OnPRis true only for the PR a lane is deciding on right now (sweeping_sinceadded tomerge_gate).noteMergeAttempt: patches the cached snapshot (closed/merged/MergedByHive), records the ledger entry and nudges SSE so the row reaches ✓ within one SPA poll.recently_closed(closed twin ofrecently_merged) fed from every closed-unmerged snapshot reachingapplyWebhookItemSnapshots;merged_hold_msin the payload.dashboard.stage_tracker.merged_hold_s(default 8, min 3), documented inwebhooks.md/operator-reference.md.SPA
celebrateDetached,stageTrackerFlyGlyph. Idempotent per PR key.recently_closed→ neutral info toast#15793 closed · superseded by #15783(reason from last known caption), no bee / count.merged_atis known.merging · waiting for GitHub…once a merge call / sweep has been on the PR > 60 s.Tests
TestSweepClockNarrowed,TestNoteMergeAttempt*,TestStageTrackerRecentlyClosed,TestStageTrackerMergedHoldKnob.TestStageTrackerRemovedRowReconcileNode(removed+merged → one celebration; removed+closed → info toast),TestStageTrackerDetachedCelebrationNode(row not in DOM → toast + bee + odometer, once), rewrittenTestStageTrackerMergingHold,TestStageTrackerOdometerWaitsForMergingHoldNode(8 s knob).Train UX gaps (left-train chip, stale "behind #N (2nd of 3)" captions) follow in a second PR.