Skip to content

πŸ› tracker: merge-failed chevron is scoped to the head it failed on - #15612

Merged
clubanderson merged 3 commits into
v5from
fix/merge-failed-chevron-head-scoped
Oct 30, 2026
Merged

clubanderson merged 3 commits into
v5from
fix/merge-failed-chevron-head-scoped

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #15611

A refused merge call is recorded with the head it was made on. The stage
tracker demotes a refusal to prior_head_merge_failed* hover history once
the PR head moves or the record regresses below 080 to wait on CI after
the refusal, so the chevron reads the live stage word and never
contradicts its caption (hive#15574).

Fixes #15611

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 30, 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 hanthor 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 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
#15574 🌱 dashboard: split stage_tracker.go into 4 files CONFLICT src/pkg/dashboard/stage_tracker.go
#15620 ✨ dashboard: running-cost tile rotates hour / today / week / month same files src/docs/dashboard-sections.md
src/pkg/dashboard/static/index.html
#15566 🌱 refactor: split stage tracker UI tests same files src/pkg/dashboard/static/index.html
#15623 πŸ› dashboard: kiosk mode renders dark by default same files src/pkg/dashboard/static/index.html
#15521 🌱 refactor: split tracker row source CONFLICT src/pkg/dashboard/static-src/js/tracker-row.js
#15565 🌱 refactor: split tracker words source CONFLICT src/pkg/dashboard/static-src/js/tracker-words.js
#15616 πŸ› tracker: PRs under repair leave the merge train same files src/docs/dashboard-sections.md
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static-src/js/tracker-words.js
src/pkg/dashboard/static/index.html
#15619 πŸ› dashboard: PRs-by-model rank uses a confidence-weighted score and normalised model ids same files src/docs/dashboard-sections.md
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_sweep.go
src/pkg/github/automerge/automerge_sweep_test.go
#15530 πŸ› fix(dashboard): issue-row linked PR passes null when the lineage chip is empty same files src/pkg/dashboard/static-src/js/tracker-row.js
src/pkg/dashboard/static/index.html
#15526 🌱 dashboard: split stage_tracker.go into 4 files same files src/docs/dashboard-sections.md
src/pkg/dashboard/stage_tracker.go

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

Looks correct to me. Read the head at the callers, not just the diff:

  • SHA shapes agree. stage_tracker.go:2320 sets Head: pr.HeadSHA (full SHA) and every sweep path hands executeMergeEffect the same full headSHA/evaluatedHeadSHA it evaluated, so the EqualFold in stageTrackerMergeAttemptStale (stage_tracker_merge_gate.go:197) compares like with like; an empty expectSHA from the relay path (pullrequest.go:476) is treated as "unknown" and falls through to the stage-regression test rather than marking every relay refusal stale.
  • The stale branch cannot shadow a live merge. The switch at :236 tests InFlight() || Merged first, so a new attempt on the current head always wins over history from an earlier one.
  • Regression test is narrow on purpose. Only stage < 080 and a CI-pending reason (required-check-pending* or whatever stageTrackerCIStateWords maps to CI running) and EnteredAt/RegressedAt after the refusal counts; a 070 row whose maintainer requested changes keeps the Merge failed word. That matches #15611's scope.
  • Frontend tolerates the new shape. When no gate existed the stale case now emits a merge_gate with empty state plus the prior_head_* fields; tracker-words.js:715 already gates on merge_gate.state being truthy, so no pill is invented and the hover note (stageTrackerPriorHeadMergeFailedNote) is the only visible effect.

TestStageTrackerMergeFailedScopedToHead / ...Node cover both the head-moved and the regressed-to-CI cases.

β€” hive: agent=reviewer-2 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.

Looks correct to me. Read at e62083e and type-checked go build ./pkg/dashboard/ on the head.

  • stage_tracker_merge_gate.go:236-259: the stale case sits between the in-flight/merged case and a.Failed(), so a stale refusal leaves mg.State as whatever stageTrackerMergeGate derived from the live stage and only fills PriorHeadMergeFailed*. The JS word table (tracker-words.js:94, :715) keys off merge_gate.state, so the chevron cannot read "Merge failed" from that path.
  • Head comparison is safe: both MergeAttempt.Head sources are full SHAs (pkg/github/pullrequest.go:476 passes expectSHA, automerge_sweep.go:3200 the sweep head) and it.Head is pr.HeadSHA (stage_tracker.go:2320), so EqualFold mismatches only on a real head move β€” an abbreviated SHA on either side would have made every refusal stale.
  • The regression branch (:200-204) requires stage < 080, a CI-pending reason via stageTrackerCIPendingReason, and EnteredAt/RegressedAt after a.EndedAt, so a refusal newer than the regression, or a regression for a non-CI reason, still shows the word. TestStageTrackerMergeFailedScopedToHead has controls for both.
  • tracker-row.js:389-390 only appends the prior-head note when !sg.cap, matching the existing actor/claimant lines.

Docs: the new paragraph in dashboard-sections.md:1217 explains the head scoping, but the table row just above ("any stage after the merge call drew N of M required status checks β†’ Waiting for CI") now only holds while the record stays at β‰₯080; once it regresses with required-check-pending:* the chevron reads the live CI word instead. Not wrong, just worth a parenthetical if you touch that table again.

β€” hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

stage 060-reviewed β†’ 050-review-pending: required-check-pending:Sign-off survives the squash

@clubanderson
clubanderson merged commit 0c06bc3 into v5 Oct 30, 2026
76 of 77 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/merge-failed-chevron-head-scoped branch October 30, 2026 02:30
@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

hivecommons-hive Bot added a commit that referenced this pull request Oct 30, 2026
Re-home the #15612 merge-failed chevron call-site change into stage_tracker_build.go.

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tracker: "Merge failed" chevron persists after the head moves and the record regresses to 050

1 participant