Repository navigation
✨ tracker: show where an adopted PR came from - #15407
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 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. |
|
stage 080-awaiting-merge-admission → 071-needs-author: conflicting |
Fixes #15396 Signed-off-by: Andrew Anderson <andy@clubanderson.com>
There was a problem hiding this comment.
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.gowith aStageTrackerLineagetype and astageTrackerLineageIndex(store, baseURL)walk overstore.Keys(); both addLineage *StageTrackerLineage \json:"lineage,omitempty"`toStageTrackerItem(herestage_tracker.go:468, there:463) and toStageTrackerLinkedPR, and both mirror it atstageTrackerResolveLinkedPRs(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: supersededrow on a still-open original (stage_tracker_lineage.go:148), foldsAdoptReasoninto fixed slugs (:63-73), handlesSupersededByand skips in-place adoptions (:118-124), and ships the SPA change instatic-src/js/tracker-row.js/tracker-actions.js/css/tracker.csswithindex.htmlregenerated, plusdashboard-sections.mdand the API-reference row. #15402 appends(adopted from #N)to the caption server-side (stage_tracker.go:2236-2238there) and editsstatic/index.htmlonly, and its branch fallback additionally requirespr.AppAuthored. #15402 already carries a hivechanges_requestedat 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
There was a problem hiding this comment.
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 addLineage *StageTrackerLineage \json:"lineage,omitempty"`to the tracker item and linked-PR structs instage_tracker.go, and both derive it from the stage store'sAdoptedBy/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_urlomitemptyand adds areasonslug 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.mdanddocs/api-reference/dashboard-misc.md. #15402 always emits the four number/url fields (noomitempty) and touches onlystatic/index.htmlon the UI side, notstatic-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
93ee68a to
331e7b4
Compare
|
@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. |
|
stage 080-awaiting-merge-admission → 050-review-pending: required-check-pending:Sign-off survives the squash |
|
merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 331e7b4. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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[].lineagemirror (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 realautomerge.AdoptReason*values (automerge_contributor_adopt.go:99-127), andchangelog.d/added-tracker-lineage-chip.mdfollows the<category>-<slug>.mdrule.
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
There was a problem hiding this comment.
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
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
There was a problem hiding this comment.
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 everyautomerge.AdoptReason*slug it switches on is defined (automerge_contributor_adopt.go:99-127); the head-branch fallback matches the realadoptBranchPrefix = "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.stageTrackerLineageFillAuthorsruns after all rows are added and beforestageTrackerResolveLinkedPRscopiespr.Lineageontolinked_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
…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>
…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>
…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>
…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>
… 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>
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.
stage_tracker_lineage.go): optionallineageon stage-tracker PR items, mirrored ontolinked_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 thehive/adopt-<n>head branch; never a GitHub call. In-place adoptions carry none. The original's row (close-first off) gets the reversekind: superseded, to_number.static-src/**+ regeneratedindex.html): compact.ham-lineagechip 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).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.htmldirectly with nostatic-src/**change, so it cannot passTestIndexHTMLIsGenerated(3/3 re-runs red ontest (rest 3/4);coverageandoverlapred too). This PR makes the change instatic-src/**and commits the generated SPA. Beyond #15402 it adds:superseded by #M · 6hchip on a still-open original;ci-red-contributor-offline,ci-red-contributor-unregistered,operator-asked, raw re-home reasons otherwise) with a per-reason hover map, andfrom_author_kindguessed from the adopt reason then overridden by the original row'sauthor_kind;.ham-lineageclass (existing.ham-badge-supersedes/adopted_fromtests untouched; the sub-row falls back to the legacyadopted_fromchip only when no lineage exists);Validation
go build ./...,go vet ./pkg/dashboard/,go test ./pkg/dashboard/... -racegreen locally;scripts/check-api-reference-citations.sh --fixclean.