Skip to content

✨ tracker: show where an adopted PR came from - #15407

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
feat/tracker-lineage-chip
Oct 29, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
feat/tracker-lineage-chip

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #15396

What

Issue #15198 showed its covering PR #15308 as Fixing with nothing saying #15308 was the hive's copy of @thatguywob's #15226 (adopted 2026-10-29T04:56Z after CI went red and the contributor's agent stayed silent; #15226 closed). Routing the fix to a hive agent read as the hive taking over a clanker's PR for no reason.

  • Server (stage_tracker_lineage.go): optional lineage on stage-tracker PR items, mirrored onto linked_prs[] — {kind: adopted|superseded|rebased-by-hive, from_number, from_url, from_author, from_author_kind, to_number, to_url, at, reason}. Derived from the stage store's adoption record (AdoptedBy/SupersededBy, AdoptedAt, AdoptReason, Author) or the hive/adopt-<n> head branch; never a GitHub call. In-place adoptions carry none. The original's row (close-first off) gets the reverse kind: superseded, to_number.
  • SPA (static-src/** + regenerated index.html): compact .ham-lineage chip beside the PR number on top-level PR rows, an issue's single covering PR and sub-rows — adopted from @thatguywob's #15226 · 6h, linked to the original, author kind as the icon only; hover Hive took this PR over after CI went red and @thatguywob's agent didn't respond. Original commits kept. stageTrackerLineageClause(item) yields (adopted from ✨ feature: enqueue eligible PRs into GitHub native merge queues #15226), applied to the Let hive decide preview ref and the row hover's Covering PR line (one-line hook for other caption renderers; the field is optional and defaults to nothing).
  • Tests: Go index / reason / head-fallback / author-fill tests on the ✨ feature: enqueue eligible PRs into GitHub native merge queues #15226→✨ feature: enqueue eligible PRs into GitHub native merge queues #15308 fixture; node-harness chip test (text, link, icon-not-word, ≤ 12 words, clause).
  • Docs: docs/dashboard-sections.md (row anatomy), docs/api-reference/dashboard-misc.md, changelog.d/added-tracker-lineage-chip.md.

Supersedes #15402

#15402 implements the same idea but edits static/index.html directly with no static-src/** change, so it cannot pass TestIndexHTMLIsGenerated (3/3 re-runs red on test (rest 3/4); coverage and overlap red too). This PR makes the change in static-src/** and commits the generated SPA. Beyond #15402 it adds:

  • the reverse superseded by #M · 6h chip on a still-open original;
  • normalised reason slugs (ci-red-contributor-offline, ci-red-contributor-unregistered, operator-asked, raw re-home reasons otherwise) with a per-reason hover map, and from_author_kind guessed from the adopt reason then overridden by the original row's author_kind;
  • a dedicated .ham-lineage class (existing .ham-badge-supersedes / adopted_from tests untouched; the sub-row falls back to the legacy adopted_from chip only when no lineage exists);
  • docs (dashboard-sections, API reference, changelog fragment).

Validation

go build ./..., go vet ./pkg/dashboard/, go test ./pkg/dashboard/... -race green locally; scripts/check-api-reference-citations.sh --fix clean.

@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 kellyaa 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 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
#15426 ✨ tracker: show who holds a claimed item on the chevron and hover CONFLICT src/docs/api-reference/dashboard-misc.md
src/pkg/dashboard/static-src/js/tracker-row.js
src/pkg/dashboard/static/index.html
#15425 ✨ feature: show local claim holders in tracker same files src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static-src/js/tracker-row.js
src/pkg/dashboard/static/index.html
#15418 🐛 Advisory issues: skip empty dedupe checklists, show as advisory in tracker 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-actions.js
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
#15424 🐛 tracker: name the clanker's owner on returned rows; flag superseded contributor PRs same files src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static-src/js/tracker-actions.js
src/pkg/dashboard/static/index.html
#15400 🐛 fix: keep merge queue position visible during sweeps same files src/pkg/dashboard/static/index.html

@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 branch conflicts with the base and needs a rebase

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: conflicting

@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
Fixes #15396

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.

Decision needed: @clubanderson should decide whether this PR or #15402 is the one that lands for #15396 — both add the same lineage field and create the same src/pkg/dashboard/stage_tracker_lineage.go, so they conflict and cannot both merge.

This conflicts with #15402 (by @mendezr, also Fixes #15396). I read both diffs in full:

  • Both create src/pkg/dashboard/stage_tracker_lineage.go with a StageTrackerLineage type and a stageTrackerLineageIndex(store, baseURL) walk over store.Keys(); both add Lineage *StageTrackerLineage \json:"lineage,omitempty"`toStageTrackerItem(herestage_tracker.go:468, there :463) and to StageTrackerLinkedPR, and both mirror it at stageTrackerResolveLinkedPRs (lp.Lineage = pr.Lineage`). Same JSON key, same semantics, different file contents → a textual and schema conflict, not two adjacent changes.
  • Where they differ: this PR also emits the reverse kind: superseded row on a still-open original (stage_tracker_lineage.go:148), folds AdoptReason into fixed slugs (:63-73), handles SupersededBy and skips in-place adoptions (:118-124), and ships the SPA change in static-src/js/tracker-row.js / tracker-actions.js / css/tracker.css with index.html regenerated, plus dashboard-sections.md and the API-reference row. #15402 appends (adopted from #N) to the caption server-side (stage_tracker.go:2236-2238 there) and edits static/index.html only, and its branch fallback additionally requires pr.AppAuthored. #15402 already carries a hive changes_requested at c3ca6e3.

On this PR's own code at 93ee68a, the Go side reads correctly to me: stageTrackerLineageFor hands each row its own *StageTrackerLineage copy (stage_tracker_lineage.go:165), so stageTrackerLineageFillAuthors (:171-191) mutating it after stageTrackerResolveLinkedPRs has copied the pointer is visible on both the row and its linked_prs[] mirror; the SupersededBy/AdoptedBy/AdoptMode fields it reads exist on stagelabels.Record (src/pkg/stagelabels/store.go:77-148), and the automerge.AdoptReason* constants are defined in automerge_contributor_adopt.go / automerge_adoption_close_first.go. Three new tests in stage_tracker_lineage_test.go; v2 Tests passed on this head.

Separately: GitHub reports this head as not mergeable against v5 (mergeable_state=dirty), so it needs a rebase regardless of which PR survives. I have not closed anything.

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

Decision needed: @clubanderson should decide which of #15407 and #15402 lands for #15396 — both create src/pkg/dashboard/stage_tracker_lineage.go with the same StageTrackerLineage type, so they conflict and cannot both merge.

This conflicts with #15402 (@mendezr), which also carries Fixes #15396. I read both diffs in full:

  • Both add src/pkg/dashboard/stage_tracker_lineage.go + _test.go, both add Lineage *StageTrackerLineage \json:"lineage,omitempty"`to the tracker item and linked-PR structs instage_tracker.go, and both derive it from the stage store's AdoptedBy/SupersededByrecord with ahive/adopt-` head-branch fallback and no GitHub calls. Same intent, same file, same type name — a merge of one makes the other a hard conflict, not a no-op.
  • They are not identical: this PR marks from_number/from_url/to_number/to_url omitempty and adds a reason slug vocabulary + stageTrackerLineageFillAuthors (stage_tracker_lineage.go), and it ships the SPA source (static-src/js/tracker-row.js, tracker-actions.js, tracker.css), docs/dashboard-sections.md and docs/api-reference/dashboard-misc.md. #15402 always emits the four number/url fields (no omitempty) and touches only static/index.html on the UI side, not static-src/.

Which should survive is the maintainer's call; the facts that bear on it: this PR is the broader of the two (SPA source + operator docs + changelog) and comes from the repository owner, but it is currently DIRTY against v5 and needs a rebase; #15402 is mergeable but already has a hive changes_requested at its current head. Whichever lands, the other should be closed with a pointer, and the SPA consumer must agree with that one's JSON shape (omitempty vs always-present numbers).

On this PR's Go side I verified: stageTrackerLineageIndex skips AdoptModeInPlace records (so in-place adoptions carry no lineage, as the body states), the hive/adopt- prefix matches adoptBranchPrefix in src/pkg/github/automerge/automerge_contributor_adopt.go, and the reverse superseded entry is written on the original's key. No defects found in what I read; I did not run the JS tests.

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

@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

stage 080-awaiting-merge-admission → 050-review-pending: required-check-pending:Sign-off survives the squash

@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
hivecommons-hive Bot merged commit 517191e into v5 Oct 29, 2026
77 of 78 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the feat/tracker-lineage-chip branch October 29, 2026 16:13
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#15407331e7b4` sha256:0f4146dfddb21fc4401ad7e3463bbf3fcf0a6fda4449ad6822f3ee351436603b — download from the dashboard or `hivectl review evidence #15407`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 331e7b4.

@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 (security, delta 93ee68a→331e7b4) — no blocking findings. Previous finding (conflict with #15402) no longer applies: #15402 is closed.

One low-severity advisory, in scope but not blocking:

hive/adopt-<n> head-branch fallback trusts a contributor-controlled name — src/pkg/dashboard/stage_tracker_lineage.go:144-154 builds lineage{kind: adopted, from_number: n, reason: ci-red-contributor-offline} from any PR whose head ref matches hive/adopt-<n>, and stage_tracker.go:2211 calls it for every PR row regardless of author. A contributor who names their fork branch hive/adopt-123 makes the tracker render "adopted from #123" (hover: Hive took this PR over after CI went red…) on their own PR, pointing at an unrelated PR. Output is fully esc()-ed and the URL is server-built (overviewItemURL), so this is misinformation only, not XSS. The fallback was only meant for the hive's own copies whose store record is gone, so gating it on the row's author kind (already computed at stage_tracker.go:2178) closes it:

		if it.AuthorKind == authorKindHive || pr.AppAuthored {
			it.Lineage = stageTrackerLineageFor(lineage, repoName, pr.Number, pr.HeadRef, status.GitHubBaseURL)
		} else if l, ok := lineage[stagelabels.Key(repoName, pr.Number)]; ok {
			it.Lineage = &l
		}

— hive: agent=adjudicator-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.

Reviewed (docs-currency, delta 93ee68a→331e7b4) — docs match the implementation; one advisory wording fix.

  • Previous finding conflicting implementation with #15402: no longer applies — #15402 is closed; this PR is the sole implementation.
  • Verified: linked_prs[].lineage mirror (stage_tracker.go, lp.Lineage = pr.Lineage), the Let hive decide preview clause and Covering PR hover (static-src/js/tracker-row.js, stageTrackerLineageClause), the hover wording/reason map keys all correspond to real automerge.AdoptReason* values (automerge_contributor_adopt.go:99-127), and changelog.d/added-tracker-lineage-chip.md follows the <category>-<slug>.md rule.

Low / in-scope — API reference overstates absence. src/docs/api-reference/dashboard-misc.md:41 says lineage appears "on the hive's copy of an adopted PR … absent on every other row", but src/pkg/dashboard/stage_tracker_lineage.go:137 also emits {kind: superseded, to_number, to_url} on a still-open original (close-first off) — which docs/dashboard-sections.md:1318 documents correctly. Suggested wording for that span:

(PRs) `lineage` — on the hive's copy of an adopted PR `{kind: adopted|rebased-by-hive, from_number, from_url, from_author, from_author_kind, at, reason}`, and on a still-open adopted original `{kind: superseded, to_number, to_url, at, reason}` — derived from the stage store's adoption record or the `hive/adopt-<n>` head branch, mirrored onto the issue's `linked_prs[]` entry; absent on rows with no adoption history —

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

Style re-review at 331e7b4 (delta since 93ee68a is a rebase onto v5 + the three upstream commits; the PR's own hunks are unchanged apart from one rebase artefact below).

Rebase re-introduces CSS that #15399 removed. src/pkg/dashboard/static-src/css/tracker.css:380-381 (and generated static/index.html:1703-1704) add back

.ham-plan-body, .ham-plan-note { white-space: pre-wrap; }
.ham-plan-note { color: var(--muted); font-size: var(--fs-xs); }

These were deleted by #15399 (commit 4fe6eb4), which replaced them with .ham-plan-body { white-space: normal; … } — now at tracker.css:361. Because the re-added rule comes later in the cascade with equal specificity, it flips the Let hive decide dialog body back to pre-wrap, quietly undoing #15399's "one clear decision, not a wall of text" layout. .ham-plan-note no longer has any producer (tracker-actions.js at head only emits ham-plan-body, line 1283), so it's dead CSS too. Neither rule belongs to the lineage feature.

Fix — drop the two lines from static-src/css/tracker.css and regenerate static/index.html:

     .ham-lineage { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: var(--sp-1); }
     .ham-lineage:hover { color: var(--text); }
-    .ham-plan-body, .ham-plan-note { white-space: pre-wrap; }
-    .ham-plan-note { color: var(--muted); font-size: var(--fs-xs); }
     .ham-seg.active .cue-acting-cap { margin-left: var(--sp-2); }

Previous finding (conflict with #15402): no longer applies — #15402 is closed.

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

@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 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 stage_tracker_lineage.go and the buildStageTracker hooks against the v5 tree at eb61710:

  • Every store field the index reads exists on the record (stagelabels/store.go:58,76-77,86-87,148,151) and every automerge.AdoptReason* slug it switches on is defined (automerge_contributor_adopt.go:99-127); the head-branch fallback matches the real adoptBranchPrefix = "hive/adopt-" + number format (automerge_contributor_adopt.go:49,814).
  • store.Keys() is sorted (store.go:1764), so the index is deterministic; the "lowest original wins" guard compares numerically, not by key string.
  • stageTrackerLineageFillAuthors runs after all rows are added and before stageTrackerResolveLinkedPRs copies pr.Lineage onto linked_prs[], so nested rows see the filled author. Nothing fetched from GitHub, as the body says.

One info note, not a defect: in stageTrackerLineageIndex, when two originals name the same copy, the continue for the higher-numbered original also skips writing its own kind: superseded entry, so that original's row (close-first off) shows no lineage. Rare enough that I would not hold the PR on it.

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

Reviewed — no findings from this perspective.

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

clubanderson added a commit that referenced this pull request Oct 29, 2026
…et hive decide

Two open PRs declaring the same Fixes #N (hive's #15402 and #15407 for
per closing issue (green head first, then earlier-opened) and holds the
other with stage reason merge-train:duplicate-of#<winner>; the tracker
shows merge_gate.state duplicate-of:<n> ("Duplicate of #15402 · needs a
pick", needs-decision) and Let hive decide takes the existing supersede
path (rule one-pr-per-issue). Also maps every merge_train state slug to
plain words (#15406 read bare "front") with a never-leak test.

Fixes #15395

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
…et hive decide

Two open PRs declaring the same Fixes #N (hive's #15402 and #15407 for
per closing issue (green head first, then earlier-opened) and holds the
other with stage reason merge-train:duplicate-of#<winner>; the tracker
shows merge_gate.state duplicate-of:<n> ("Duplicate of #15402 · needs a
pick", needs-decision) and Let hive decide takes the existing supersede
path (rule one-pr-per-issue). Also maps every merge_train state slug to
plain words (#15406 read bare "front") with a never-leak test.

Fixes #15395

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
…et hive decide

Two open PRs declaring the same Fixes #N (hive's #15402 and #15407 for
per closing issue (green head first, then earlier-opened) and holds the
other with stage reason merge-train:duplicate-of#<winner>; the tracker
shows merge_gate.state duplicate-of:<n> ("Duplicate of #15402 · needs a
pick", needs-decision) and Let hive decide takes the existing supersede
path (rule one-pr-per-issue). Also maps every merge_train state slug to
plain words (#15406 read bare "front") with a never-leak test.

Fixes #15395

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
…et hive decide

Two open PRs declaring the same Fixes #N (hive's #15402 and #15407 for
per closing issue (green head first, then earlier-opened) and holds the
other with stage reason merge-train:duplicate-of#<winner>; the tracker
shows merge_gate.state duplicate-of:<n> ("Duplicate of #15402 · needs a
pick", needs-decision) and Let hive decide takes the existing supersede
path (rule one-pr-per-issue). Also maps every merge_train state slug to
plain words (#15406 read bare "front") with a never-leak test.

Fixes #15395

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
hivecommons-hive Bot pushed a commit that referenced this pull request Oct 29, 2026
… warning (#15427)

* ✨ tracker: merge queue position on the chevron, stable wording, stall warning

Position chip "In merge queue · 2 of 6 · ~4m" (front: "Next to merge · 1 of 4"),
label stable across sweeps (sweep = spinning ⬡ + "Checking now…"), Merge queue
popover in the sticky bar, countdown to the member's turn anchored server-side
(merge_train.eta_s/eta_at/eta_basis/late), stall warning with
governor.merge_train_stall_warn_s (default 3600) and an hourly activity line,
and a words table so no merge_train state slug (front, queued-behind, …) can
reach a chip again.

Fixes #15395

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

* ✨ merge queue: one PR per issue — hold the duplicate, supersede via Let hive decide

Two open PRs declaring the same Fixes #N (hive's #15402 and #15407 for
per closing issue (green head first, then earlier-opened) and holds the
other with stage reason merge-train:duplicate-of#<winner>; the tracker
shows merge_gate.state duplicate-of:<n> ("Duplicate of #15402 · needs a
pick", needs-decision) and Let hive decide takes the existing supersede
path (rule one-pr-per-issue). Also maps every merge_train state slug to
plain words (#15406 read bare "front") with a never-leak test.

Fixes #15395

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

---------

Signed-off-by: Andrew Anderson <andy@clubanderson.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: an adopted PR's row never says where it came from

1 participant