Skip to content

🐛 tracker: merge outcomes always render in the Merge gate column; pending CI is not 'red' - #15408

Merged
clubanderson merged 2 commits into
v5from
fix/merge-gate-column
Oct 29, 2026
Merged

clubanderson merged 2 commits into
v5from
fix/merge-gate-column

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #15404

Operator report (hive's own spoke, row docs#496 → PR hivecommons/docs#512, 2026-10-29 11:04 ET): the amber "⟳ Merge failed · merge sweep running ⬡" chip sat in the CI / Review column, its label spilled GitHub's raw PUT https://api.github.com/… error, and the caption read "fell back to stage/060-reviewed — … CI is red (check-pending)".

Root causes

  • Column: stageTrackerAnchor mapped stage 60 → column 50 unconditionally and the gate chip is drawn on whichever segment is active, so a merge attempt on a row the lane set back to 060 landed in CI / Review.
  • Sweep: with the required-check set unreadable the sweep runs server-enforced and lets GitHub decide; GitHub's 405 "N of N required status checks are expected" was recognised but never remembered, so every pass (event-triggered, "next sweep in 7s") re-PUT /merge, and each refusal was recorded as a failed merge attempt that lit "Merge failed".

Changes

  • SPA (static-src, regenerated index.html): stageTrackerAnchor(stage, stages, kind, item) — a merge_gate.state of merging / merge-failed anchors the row in the Merge gate column whatever its numeric stage (a stale gate on a PR back at ≤ 030 does not jump it forward). The merge-failed branch now precedes sweep_running: "Merge failed · retrying" while the sweep is on it, else "Merge failed · "; a 405 "required checks expected" refusal is honestly "Waiting for CI · 4 checks". The chip is a fixed short phrase (≤ 5 words, no URL/verb) from merge_failed_kind, with the plain sentence and GitHub's raw text (after "Details:") in the tooltip; .ham-gate-detail gets max-width + ellipsis. Gate words: pending → "CI running", failing → "CI failed: lint". stageTrackerStageName gives cues/tooltips plain words ("fell back to Reviewed") — a minimal local fix in the same helper; the copy agent is retiring stage slugs globally.
  • Go dashboard: stageTrackerMergeRefusal (new stage_tracker_merge_refusal.go) translates refusals → kind / sentence / check count (merge_failed_kind, merge_failed_text, merge_failed_checks on merge_gate); stageTrackerCIStateWords renders check-* / status-* tokens as "CI running" / "CI green" / "CI failed: " in humanizeStageReason.
  • automerge: Engine.requiredChecksExpected wraps requiredChecksExpectedMergeError at the three merge sites and remembers the head; knownMergeRefusal returns check-pending on later passes while the same head is still blocked (re-armed by a new head, an unblocked state or the 30 m recheck).
  • Tests: node harness TestStageTrackerMergeFailedColumnNode with the exact payload (stage 60, merge-failed, sweep_running, raw 405) — column 80, chip wording, no http/PUT, ≤ 5 words, Details line, CI words, cue text; Go TestStageTrackerMergeRefusal, TestHumanizeStageReason cases, TestRequiredChecksExpectedRemembered.
  • Docs legend row updated; changelog fragment.

Notes

  • "Retry" in the ⋯ menu: the existing "Re-evaluate now" action already triggers a targeted pass, so no new menu item.
  • Closed issue + open PR rows stay on the board (🐛 tracker: closed superseded PRs no longer render as rows #15267 hides closed superseded PR rows only); the issue-side "closed" chip is correct.
  • Scoped away from the concurrent tracker hover/caption copy and decide-dialog work.

…ding CI is not 'red'

A merge outcome (merging / merge-failed) on a row the lane set back to
060 was drawn in CI / Review because stageTrackerAnchor mapped stage 60
to column 50 regardless of merge_gate; the chip carried GitHub's raw
error text (a PUT …/merge URL) and the caption read 'CI is red
(check-pending)' and 'fell back to stage/060-reviewed'.

- stageTrackerAnchor: a merge_gate state of merging / merge-failed
  anchors the row in the Merge gate column whatever its numeric stage.
- Go: stageTrackerMergeRefusal translates GitHub's refusal into a kind,
  a plain sentence and (for 405 'required status checks are expected')
  the check count; the SPA renders a fixed short chip ('Waiting for CI ·
  4 checks', 'Merge failed · retrying', 'Merge failed · branch
  protection') with the raw text only after 'Details:' in the tooltip;
  .ham-gate-detail is clamped with an ellipsis.
- stageTrackerCIStateWords: check-/status- tokens read 'CI running',
  'CI green', 'CI failed: <check>' — pending is never red (Go caption
  and SPA gate words).
- stageTrackerStageName: cues and tooltips name a stage in words
  ('back to Reviewed'), not by its slug — a minimal local fix; the copy
  sweep retires stage slugs globally.
- automerge: the sweep remembers GitHub's 'required status checks are
  expected' 405 per head and skips the merge call as check-pending while
  the PR is still blocked, instead of re-PUTting /merge every pass.

Fixes #15404

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 29, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nicholasjackson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 29, 2026
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#15407 ✨ tracker: show where an adopted PR came from same files src/docs/dashboard-sections.md
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static-src/css/tracker.css
src/pkg/dashboard/static-src/js/tracker-row.js
src/pkg/dashboard/static/index.html
#15420 ✨ Let hive decide: operator-action for selfreports, evidence-gated proposals same files src/docs/dashboard-sections.md
src/pkg/dashboard/static/index.html
#15414 🐛 fix: make tracker action captions readable same files src/pkg/dashboard/static-src/css/tracker.css
src/pkg/dashboard/static/index.html
#15400 🐛 fix: keep merge queue position visible during sweeps same files src/pkg/dashboard/stage_tracker_merge_gate_test.go
src/pkg/dashboard/static-src/js/tracker-words.js
src/pkg/dashboard/static/index.html
#15418 🐛 Advisory issues: skip empty dedupe checklists, show as advisory in tracker CONFLICT src/pkg/dashboard/static-src/js/tracker-row.js
src/pkg/dashboard/static/index.html
#15308 ✨ feature: enqueue eligible PRs into GitHub native merge queues same files src/pkg/github/automerge/automerge_contributor_lane.go
src/pkg/github/automerge/automerge_merge_refusal.go
src/pkg/github/automerge/automerge_sweep.go
#15416 🐛 tracker: readable progress label when a chevron action is running same files src/pkg/dashboard/static-src/css/tracker.css
src/pkg/dashboard/static/index.html

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@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.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • build-and-test

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.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

stage 080-awaiting-merge-admission → 071-needs-author: required-check-failing:build-and-test

…d-column node suite

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from this perspective.

— hive: agent=adjudicator-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

stage 080-awaiting-merge-admission → 050-review-pending: review-gate:no-review-bundle

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style / maintainability review (head e4b72c8)

1. src/docs/dashboard-sections.md:1161-1162 — the new paragraph splits the legend table. The blank line + prose inserted before the | 110 | **Merged** … row ends the Markdown table, so that row renders as a stray literal | 110 | ... line. Move the paragraph below the table. While there, the 060 row (line 1153) still quotes the old tooltip wording CI still running (build-and-test), which this PR changes to CI running (build-and-test) (stage_tracker_merge_gate_test.go:213).

 | any stage after the merge call drew *N of M required status checks are expected* (`merge_failed_kind: checks-pending`, `merge_failed_checks`) | **Waiting for CI** | *4 checks* | ⟳ while the sweep is on it, else 🕓 — *… It merges once they pass.* |
-
-A merge outcome (**Merging**, **Merge failed**, **Waiting for CI**) always lights the **Merge gate** column, whatever numeric stage the lane fell back to (hivecommons/docs#512 drew "Merge failed" in CI / Review because the PR sat at 060).
 | 110 | **Merged** (the ✓ cap) | — | — |
+
+A merge outcome (**Merging**, **Merge failed**, **Waiting for CI**) always lights the **Merge gate** column, whatever numeric stage the lane fell back to (hivecommons/docs#512 drew "Merge failed" in CI / Review because the PR sat at 060).

2. static-src/js/tracker-words.js:652-659 — a second, already-divergent refusal classifier. stageTrackerMergeRefusalFromRaw re-implements Go's stageTrackerMergeRefusal (stage_tracker_merge_refusal.go:48-85) "abridged": it has no review / method / merge-queue kinds, so 405 At least 1 approving review is required is review server-side but protection client-side. The only writer of merge_failed sets merge_failed_kind in the same statement (stage_tracker_merge_gate.go:184-185), and the SPA ships inside the same binary, so the "older payload" branch is unreachable in production — it only exists so fixtures without merge_failed_kind (stage_tracker_merging_hold_test.go:295, stage_tracker_merge_failed_column_test.go cases 3-7) keep passing. Suggest deleting the JS fallback and giving those fixtures merge_failed_kind/merge_failed_text, so there is one source of truth for the mapping.

3. static-src/js/tracker-words.js:690-692 — stageTrackerMergeFailedShort is now dead. Its last caller was the removed merge-failed branch; nothing in static-src/js references it or STAGE_TRACKER_MERGE_FAILED_SHORT_MAX any more (only stage_tracker_merge_gate_test.go:314 and stage_tracker_merging_hold_test.go:473-475). The rewritten comment "(tooltips and toasts; …)" describes callers that do not exist. Remove the helper, the const and their asserts, or at least drop the comment claim.

— hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed (intent-alignment) — the diff covers every bullet of #15404 (column anchor, pending≠red, retrying vs failed, raw error out of the chip, "Waiting for CI · N checks", stage-slug leak, sweep memory); all five stageTrackerAnchor callers pass item, and the 10 m MergeAttemptRetention bounds the forced Merge-gate anchor. No in-scope findings.

Out of scope (backlog, not blocking): the queued-merge path src/pkg/github/automerge/automerge_sweep.go:2681-2698 still has no requiredChecksExpected branch — a 405 "N of M required status checks are expected" there goes straight to refusedMerge → "merge-failed" and re-PUTs /merge each pass, the same loop this PR closes at the other three sites. The PR body says "three merge sites", so this is a known gap rather than a regression.

— hive: agent=adjudicator-3 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Hive filed review findings that do not block this PR as backlog items:

Cap: 10 backlog item(s) per PR per day.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed (correctness) — no in-scope findings at e4b72c8. Column anchoring, refusal translation, humanizeStageReason ordering (the check-runs/status-check cases still precede stageTrackerCIStateWords, stage_tracker.go:1322-1328) and the refusal-memory locking (checksExpectedKnown runs under mergeRefusalsMu in knownMergeRefusal, automerge_merge_refusal.go:168-172) all check out; the node harness exercises the exact docs#512 payload.

Adjacent, not blocking (backlog): the queued lane's merge site (trySweepQueuedPR, automerge_sweep.go:2681-2700) is the one merge path not wrapped in requiredChecksExpected, so a 405 "required status checks are expected" there still falls through refusedMerge → "merge-failed" and is re-PUT every pass. Pre-existing; the issue's report was the self-authored lane.

— hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Why:

  • the review swarm requested changes

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.

@clubanderson
clubanderson merged commit 35adf06 into v5 Oct 29, 2026
75 of 76 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/merge-gate-column branch October 29, 2026 15:53
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts-with-open-pr Open PR has a merge conflict with another open PR dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

1 participant