Skip to content

🐛 fix: show adopted PR provenance in the stage tracker - #15402

Closed
mendezr wants to merge 1 commit into
hivecommons:v5from
mendezr:fix/tracker-adoption-provenance
Closed

mendezr wants to merge 1 commit into
hivecommons:v5from
mendezr:fix/tracker-adoption-provenance

Conversation

@mendezr

@mendezr mendezr commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add optional adoption lineage from stage-store records, with an App adoption-branch fallback and no GitHub fetches.
  • Mirror lineage onto linked PRs and show the original contributor PR beside the live copy, in captions, and in Let hive decide previews.
  • Keep unknown facts omitted and avoid duplicate legacy adoption/supersession chips.

Fixes #15396

Validation

  • Added Go payload/regression tests and JavaScript chip/preview coverage for close-first adoption, original-open adoption, branch fallback, repository isolation, and escaping.
  • Changed Go files formatted; gofmt -l is clean.
  • Tests not run locally per AGENTS.md; CI is the test verdict.

— hive: backend=pi model=openai-codex/gpt-6.1-sol


🐝 Hive Agent: contributor | SHA: c3ca6e354

Carry adoption lineage from the stage store (or an App adoption branch) onto the live PR and linked rows, and identify the original in chips, captions and decision previews without GitHub requests.

Hive-Run: hivecommons#15396
Hive-Plan: tracker-adoption-lineage
Hive-Spec: hivecommons#15396#fix
Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com>
Signed-off-by: mendezr <mendezr@users.noreply.github.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 danathar 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
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@mendezr this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Failing checks:

  • overlap
  • test (rest 3/4)

Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path.

Queued in your relay fix queue (1 waiting): fixes are handed out before new work as soon as you have capacity.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

stage 080-awaiting-merge-admission → 072-returned-to-contributor: optional-check-failing:overlap

@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
#15409 🐛 dashboard: bigger merge bee and a visible odometer roll on the Merged counter same files src/pkg/dashboard/static/index.html
#15407 ✨ tracker: show where an adopted PR came from same files src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/stage_tracker_lineage.go
src/pkg/dashboard/stage_tracker_lineage_test.go
src/pkg/dashboard/static/index.html
#15406 🐛 tracker: say it once, in plain words — simplify hovers, menus and captions same files src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
#15400 🐛 fix: keep merge queue position visible during sweeps same files src/pkg/dashboard/static/index.html
#15408 🐛 tracker: merge outcomes always render in the Merge gate column; pending CI is not 'red' same files src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html

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

One blocking problem, and it is why CI is red: the SPA half of this change was written into the generated static/index.html only, not into static-src/.

  • src/pkg/dashboard/static/index.html is generated from static-src/ (Makefile:8-13, make dashboard-gen / dashboard-gen-check). This diff adds stageTrackerLineageClause, stageTrackerLineageChipHtml and the six call-site edits at index.html:15642-16068, 16295, 16332, 19049-19050, but touches no file under static-src/js/.
  • test (rest 3/4) fails on exactly this: indexgen_test.go:28: static/index.html differs from the concatenation of static-src/ (first difference at line 15642, byte 8) — line 15642 is the first new JS line. coverage and test are red only because that shard is. I reproduced it on c3ca6e3 with go run ./pkg/dashboard/webstatic/gen -src pkg/dashboard/static-src -out pkg/dashboard/static/index.html -check → out of date.
  • Consequence beyond CI: the next make dashboard-gen by anyone erases the chip, the lineage: field in stageTrackerLinkedPRItem, and the plan-ref suffix, while the Go side keeps emitting lineage. TestStageTrackerLineageJS would then fail on an unrelated PR.

Fix: move the JS into the source files the functions live in — stageTrackerSupersedesChipHtml / stageTrackerLinkedPRItem / stageTrackerAdoptedFromChipHtml are in static-src/js/tracker-row.js:457,819,839, stageTrackerFetchDelegatePlan in static-src/js/tracker-actions.js:1221 — then make dashboard-gen and commit the regenerated index.html.

The Go side reads correctly to me against the tree: stageTrackerLineageIndex keys on the adopter and keeps the lowest original (stage_tracker_lineage.go:44-46), the branch fallback refuses non-App heads and self-references (:60-66), lineageAuthors is filled in addPR before the post-pass so an open original's author kind is picked up (stage_tracker.go:2162, 2268-2275), and the linked-PR copy mirrors Lineage (:3026). Close-first adoption — the case #15396 describes — is covered by the close-first subtest.

Minor, not blocking: it.Caption += " (adopted from #N)" (stage_tracker.go:2237) appends with a leading space even when Caption is empty, and the same fact then also appears as the chip beside the number — consider one or the other.

overlap failed with invalid character 'S' looking for beginning of value in pr-overlap.sh — that is the script choking on a non-JSON response, not this diff.

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

One blocking defect, verified by running the generator: the JavaScript side of this change was written directly into the generated artifact src/pkg/dashboard/static/index.html, and src/pkg/dashboard/static-src/js/ is untouched (git diff --stat lists no static-src file).

src/docs/dashboard-source-layout.md:10-15 is explicit — "Edit static-src/**, run make dashboard-gen, commit both" — and TestIndexHTMLIsGenerated (pkg/dashboard/webstatic/indexgen_test.go) fails whenever the committed index.html differs from its sources. On this head, c3ca6e3:

$ go run ./pkg/dashboard/webstatic/gen -src pkg/dashboard/static-src -out pkg/dashboard/static/index.html -check
pkg/dashboard/static/index.html is out of date with pkg/dashboard/static-src; run `make dashboard-gen`
exit status 1

Consequence: build-and-test will go red on that test, and even if it were merged, the next contributor who runs make dashboard-gen would silently delete stageTrackerLineageClause, stageTrackerLineageChipHtml and the five call-site edits, leaving the Go payload emitting lineage that nothing renders. Fix: move the JS edits into the matching static-src/js/tracker-row.js (the supersedes chip they sit beside lives at tracker-row.js:446-457) and the lineage: lp.lineage || null / delegate-plan edits into their source files, then run make dashboard-gen and commit both.

The Go side reads correctly to me: stageTrackerLineageIndex keys on the adopting PR and keeps the lowest original when two records point at one copy (stage_tracker_lineage.go:42); the hive/adopt-N fallback is gated on pr.AppAuthored (:60) so a contributor branch cannot forge provenance; and the post-pass at stage_tracker.go:2268-2275 only overwrites FromAuthor when the original is still in the open-PR set, falling back to the store's rec.Author otherwise. The Go tests cover open, close-first, repo-scoping and the fallback, and TestStageTrackerLineageJS does exercise the chip — so the body's validation claims hold once the source files carry the JS.

(The overlap check failing is the repo's open-PR file-overlap guard, not something in this diff.)

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

@clubanderson

Copy link
Copy Markdown
Member

Superseded by #15407, which carries the same lineage field/chip plus the reverse "superseded by" chip and passes TestIndexHTMLIsGenerated (this PR edits static/index.html without static-src/**, so the generated-SPA check fails on every rerun). Closing to keep one PR per issue (#15396).

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

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

2 participants