Skip to content

πŸ› tracker: closed superseded PRs no longer render as rows - #15267

Merged
clubanderson merged 1 commit into
v5from
fix/tracker-drop-closed-superseded-prs
Oct 29, 2026
Merged

clubanderson merged 1 commit into
v5from
fix/tracker-drop-closed-superseded-prs

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #15265

Root cause

GET /api/stage-tracker built an issue's linked_prs from the enumeration's claims index (issue.LinkedPRs), whose state is "open" unless merged β€” it never says "closed". After close-first supersession the closed original therefore passed the !Merged && State != "closed" filter; having no row of its own (not an open item) it stayed a bare {number, url} entry, which the SPA drew as a sub-row with stage 0, no title and a full-height empty ladder (#15183 β†’ ↳ #15184, #15169 β†’ ↳ #15170).

Fix

  • stageTrackerResolveLinkedPRs drops a linked PR that has no PR row in the response unless the caller vouches it is open elsewhere (cross-repo); addIssue also asks the cache state resolver and drops closed/merged links at the source.
  • The live replacement PR (and its sub-row) carries supersedes: {number, url, closed_at, open} from the original's SupersededBy record; the SPA draws one muted supersedes #N chip (hover: closed , link). Nothing else β€” the closed PR never renders.
  • The issue's ladder now follows the live PR alone.

Verified against the live spoke payload for #15183 before the fix (bare #15184 entry present). Tests: Go snapshot filtering + chip metadata, resolver unit test, supersedes index, node assertions for the chip and sub-row item.

@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 needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 29, 2026
@hivecommons-hive hivecommons-hive Bot added author/human A person pushed this PR themselves dco All commits are DCO signed-off stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act labels Oct 29, 2026
A PR the hive closed when it opened its replacement (close-first
supersession) rode under its issue as a bare sub-row with an empty
ladder: the claims index still reported it open, and the resolver kept
the unmatched link. A linked PR with no PR row in the snapshot is now
dropped (the cache state resolver also drops closed/merged links at
the source); the live replacement carries supersedes metadata and the
SPA draws one muted "supersedes #N" chip as the only trace.

Fixes #15265

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@clubanderson
clubanderson force-pushed the fix/tracker-drop-closed-superseded-prs branch from 9cec241 to 6281691 Compare October 29, 2026 03:00
@kubestellar-prow kubestellar-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. 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
#15270 πŸ› fix(kick-logs): archive kick log when the turn ends, not only at the next rotation point same files src/pkg/dashboard/static/index.html
#15236 πŸ› Prefer covering PR progress in Activity Monitor messages same files src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/stage_tracker_test.go
#15134 πŸ› Delegated decision on a capability gap: model the blocker, stop the un-park/re-park loop, name the missing App permission same files src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
#15253 πŸ› decision toast: issue decisions no longer read as 'approved for merge' same files src/pkg/dashboard/static/index.html
#15219 πŸ› fix: preserve human and owner PRs during delegated decisions same files src/pkg/dashboard/delegated_pr_context.go
src/pkg/dashboard/delegated_pr_context_test.go
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/stage_tracker_adoption.go
src/pkg/dashboard/static/index.html
#15104 πŸ› Activity Monitor: Rebase, then merge as maintainer; fixer owns parked conflicting PRs; dismiss self-inflicted changes_requested same files src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
#15186 πŸ› Activity Monitor: one coherent post-decision state for Let hive decide rows; 060 reviewed in CI / Review same files src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/stage_tracker_adoption.go
src/pkg/dashboard/static/index.html
#15256 πŸ› clanker PRs with a human changes-requested review show Returned to contributor, not Sentinel alert same files src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 29, 2026
@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 hivecommons-hive Bot added role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act labels Oct 29, 2026
@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 29, 2026

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

Read the diff against v5 at merge-base 4db33fe plus the seams it leans on. Looks correct to me.

What I verified:

  • stageTrackerResolveLinkedPRs (src/pkg/dashboard/stage_tracker.go:2873-2876) now drops a linked PR with no PR row unless open(repo, n) vouches for it. The vouch passed from buildStageTracker (stage_tracker.go:1974) is stageTrackerPRStateResolver(...) == "open", and that resolver (stage_tracker.go:1150-1163) answers open for any PR in repoOpenItems across all repos in the status payload β€” so an open PR that addPR filtered out of items, or a cross-repo PR, still survives as a bare link. Only PRs absent from the open snapshot (closed/merged, or the claims index lagging a close) are dropped. Unknown ("") is kept by stageTrackerLinkedPRFinished, so a resolver miss fails safe.
  • The second caller, delegatedCompetingNumbers (delegated_pr_context.go:45), passes an always-true vouch, preserving its prior behaviour.
  • stageTrackerSupersedesIndex keys by stagelabels.Key, which lowercases (stagelabels/store.go:493-495), matching the lookup at stage_tracker.go:2081. SupersededBy is also set by the older merged-copy path (#14471), but there the superseder is merged and not a row, so the chip can only appear on a live close-first copy.
  • TestStageTrackerClosedSupersededPRNotASubRow reproduces the reported shape (claims index says #15184 open, snapshot lacks it) and asserts both the drop and the chip metadata.
  • go build ./pkg/dashboard/ ./pkg/stagelabels/ at 6281691 passes.

No findings. Not approving (human signature); flagging as ready for a maintainer's read.

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

Read the diff against v5 plus the callers; this looks correct to me.

What I verified:

  • stageTrackerResolveLinkedPRs (src/pkg/dashboard/stage_tracker.go:2826) now drops a linked PR with no PR row unless open(repo, n) vouches for it. In buildStageTracker that callback is prState(...) == "open" (stage_tracker.go:1974), and stageTrackerPRStateResolver (stage_tracker.go:1144) builds its open set from every repo in the snapshot, so the cross-repo case the doc comment describes is covered. The only other caller (delegated_pr_context.go:45) passes an always-true vouch over an already-open-filtered list, which is the right thing there.
  • Supersede filename matching in stageTrackerSupersedesIndex keys on stagelabels.Key(repo, rec.SupersededBy); the lookup in addPR uses the same Key(repoName, pr.Number), so the chip lands on the live copy. TestStageTrackerClosedSupersededPRNotASubRow exercises the exact claims-index-lag shape from #15265.
  • go build ./pkg/dashboard/ passes on the head.

One semantic note, not a defect: a linked PR whose state the caches cannot resolve ("" β€” e.g. a PR the hive just opened that the status snapshot hasn't picked up yet) is kept by the addIssue filter (stageTrackerLinkedPRFinished treats unknown as not finished) but then dropped by stageTrackerResolveLinkedPRs, so it won't appear until the next snapshot lists it. That matches the PR's goal (a bare {number,url} sub-row with an empty ladder is exactly the artefact being removed), just flagging that unknown β‰  open here in case anyone expects the sub-row to show during that window.

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

@hivecommons-hive hivecommons-hive Bot added stage/095-pre-merge-soak Lane admitted; the pre-merge soak window is running before the merge is attempted stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/095-pre-merge-soak Lane admitted; the pre-merge soak window is running before the merge is attempted labels Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

stage 095-pre-merge-soak β†’ 060-reviewed: required-check-pending:Sign-off survives the squash

@hivecommons-hive hivecommons-hive Bot added stage/095-pre-merge-soak Lane admitted; the pre-merge soak window is running before the merge is attempted stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) stage/095-pre-merge-soak Lane admitted; the pre-merge soak window is running before the merge is attempted labels Oct 29, 2026
@clubanderson
clubanderson merged commit 7e06d44 into v5 Oct 29, 2026
94 of 103 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/tracker-drop-closed-superseded-prs branch October 29, 2026 03: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

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

Labels

author/human A person pushed this PR themselves dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/L Denotes a PR that changes 100-499 lines, ignoring generated files. stage/095-pre-merge-soak Lane admitted; the pre-merge soak window is running before the merge is attempted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

πŸ› tracker: closed superseded PRs render as empty sub-rows under their issue

1 participant