Skip to content

πŸ› fix(dashboard): enrich soft-linked stage-tracker issues with title and state - #14630

Merged
hivecommons-hive[bot] merged 3 commits into
v5from
scanner/fix-14606
Oct 27, 2026
Merged

hivecommons-hive[bot] merged 3 commits into
v5from
scanner/fix-14606

Conversation

@hivecommons-hive

@hivecommons-hive hivecommons-hive Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Stage-tracker PR rows whose only linked issue is a soft refs/title/mention link carried just a number, so the UI fell through to "(title unavailable)" even for real closed issues. After #14579 the URL is right but the title/state are still missing.

The tracker now does one issues GET per distinct same-repo number for such links and fills in title and state. It runs only on a tracker rebuild, so results are cached for the tracker TTL. Failed lookups, and numbers that are PRs, leave the link untouched.

Closes #14606

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 requested_by=@clubanderson

Update: review fixes and #14667

Why the review changes. Both reviews pointed out that "cached for the tracker TTL" did not hold: UpdateStatusIfFresh drops the tracker cache on every status publish, so the issues GETs re-ran every eval cycle. They also ran serially with context.Background() while stageTrackerCacheMu was held, so a slow GitHub could stall the status publisher and every /api/stage-tracker GET. Changes:

  • Lookups are memoised per Server keyed by owner/repo#number. Results are kept for 15 min, and failed lookups for 2 min, so persistent 404s don't use up the budget on every rebuild.
  • Each rebuild makes at most 10 GETs, all under one context.WithTimeout of 3 s (same pattern as api_acmm_eval.go). Hitting the budget is not memoised; the next rebuild retries. The lookups stay inside the mutex: moving them out would need a rebuild-generation guard against the publish-time invalidation. With the memo and the bound, the lock hold is now cold-cache only and at most 3 s.
  • The stageTrackerRESTCaller comment no longer claims the handler never reaches GitHub.

#14667.

  1. A bare first-paragraph mention no longer binds when its clause says it is left out (remain(s), remaining, left open/for/to, not covered, out of scope, not in this PR). It also no longer binds when it sits inside a parenthetical qualifying the reference before it. So Part of #14550 (tracker; #14559 backend-specific routes remain) no longer draws [scanner] repeat-failure: backend-specific routes (copilot, omp, openhands, muse, agy, aider) and real-run evidenceΒ #14559 as covered by the PR (github.PRReferencedIssues).
  2. Untitled, unlisted links are now resolved by the same memoised lookup, including closing keywords hive read from the text, such as an adoption body's "close ✨ feature(crux): export OTel spans and kick metrics over OTLP when configured #14592". A number that the issues API reports as a pull request, open or closed, is dropped from the PR's links instead of rendering as "(title unavailable)". Before, only open PRs present in the response were pruned. (Grouping one PR's several issues into one row, the issue's third bullet, is not part of this fix.)

Closes #14667

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 27, 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 27, 2026
@github-actions

github-actions Bot commented Oct 27, 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
#14573 ✨ feat(dashboard): show a draft pill in the activity tracker same files src/pkg/dashboard/stage_tracker.go
#14701 ✨ feat(hub): add S256 PKCE verifier cookie to the Hub GitHub login same files src/docs/api-reference.md
#14651 🌱 dashboard: defer merge-gate pills until the PR reaches the gate same files src/pkg/dashboard/stage_tracker.go
#14524 ✨ feat(hub,agent): Hub-coordinated live CLI session pool for multi-tenant runner capacity same files src/docs/api-reference.md
#14682 🌱 runtime: loopback pprof, periodic memstats and cgroup-aware GOMEMLIMIT same files src/docs/api-reference.md
src/pkg/dashboard/server.go

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending β€” sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

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

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off 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 labels Oct 27, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conclusion: the enrichment does what #14606 asks and the test covers the dedupe/PR/404 cases, but it moves live GitHub reads into the /api/stage-tracker request path and the "cached for the tracker TTL" premise does not hold β€” I'd want the lookups memoised across rebuilds before this lands.

What I read: src/pkg/dashboard/stage_tracker.go at c21cbbb (call site 1434, stageTrackerEnrichSoftLinks 1606–1645), invalidateStageTrackerCache 1465, server.go:2638–2641, src/pkg/github/advisory_work.go:53.

  1. Lookups repeat on every status publish, not every TTL (medium) β€” server.go:2641 calls invalidateStageTrackerCache() on each status publish and then nudges the SPA to refetch, so stageTrackerPayload rebuilds on the next GET regardless of StageTrackerCacheTTL. The got map in stageTrackerEnrichSoftLinks (stage_tracker.go:1615) is local to one call, so every rebuild re-issues one issues GET per distinct soft-linked number β€” titles/states that effectively never change are fetched once per eval cycle for the life of the PR. The PR body's "results are cached for the tracker TTL" is true only when no publish intervenes, which is not the normal cadence. A per-Server memo keyed by owner/repo#number (with its own TTL or invalidated by the webhook path) would make the cost one GET per issue instead of one per cycle.

  2. Serial network calls under stageTrackerCacheMu, in the HTTP handler (medium) β€” stageTrackerPayload holds the mutex for the whole build (stage_tracker.go:1425–1426), and the enrichment now does N sequential Issues.Get calls inside it. Every concurrent /api/stage-tracker GET blocks behind those round-trips, and the first request after each publish pays the full latency. Previously the build was pure CPU over the status payload. If the memo in (1) lands, this mostly collapses to the cold case, but it is worth stating since the handler was designed as "never reaches GitHub".

  3. Stale comment (low, docs-currency) β€” stage_tracker.go:1402–1405 still says stageTrackerRESTCaller tags requests "listed with Charged 0: the handler never reaches GitHub"; after this change the same caller tag also labels real charged GETs. Update the comment so the rate-limit panel reads right.

Minor / not blocking: context.Background() at stage_tracker.go:1633 is bounded only by the client's HTTP timeout; passing a derived context with a short deadline (or the request ctx) would keep one slow GitHub call from stalling the whole tracker build.

I have not approved or requested changes as a review event; this is a comment for the maintainer and the scanner lane to act on.

β€” 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 Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the diff against the v5 tree (stage_tracker.go, server.go, etagcache.go, slowstart.go, app.go) and built ./pkg/github ./pkg/dashboard at c21cbbb β€” compiles clean. The enrichment logic itself is correct: soft-only filter at stage_tracker.go:1625, per-rebuild dedupe via got, failed lookups and PR numbers left untouched, and the test covers each of those paths. One thing a maintainer should weigh before this lands:

The issue GETs run serially, with no deadline, while stageTrackerCacheMu is held (medium).

  • stageTrackerPayload takes s.stageTrackerCacheMu.Lock() with defer Unlock() (stage_tracker.go:1426-1427) and then calls stageTrackerEnrichSoftLinks (:1434), which issues one Issues.Get per distinct soft-linked number using context.Background() (:1633). The only bound is the App HTTP client's 30s timeout (github/app.go:720), per request.
  • UpdateStatusIfFresh calls invalidateStageTrackerCache() on every status publish (server.go:2641), which also takes stageTrackerCacheMu (stage_tracker.go:1466). So while a rebuild is fetching N issues, the status publisher β€” and every concurrent GET /api/stage-tracker β€” blocks behind it. Under the slow-start caution window (slowstart.go:40-46, ~2–3s per request, globally serialized) a tracker with a dozen soft-linked issues holds that mutex for 30s+; a hung GitHub connection holds it for 30s Γ— N.
  • Before this change nothing network-bound ran under that lock, so this is a new stall path rather than a widening of an existing one.

Suggestions, either of which would settle it: wrap the lookups in a context.WithTimeout (the repo already does this for dashboard-initiated GitHub calls, e.g. api_acmm_eval.go:280), and/or cap the number of lookups per rebuild. Moving enrichment outside the mutex would be cleaner still but is a bigger change.

Small body/code gap, for accuracy: the body says results are "cached for the tracker TTL", but server.go:2641 drops the cache on every status publish, so the GETs re-run each eval cycle, not once per TTL. The ETag transport (etagcache.go:130-134) makes the repeats conditional, so quota is fine β€” this only matters for how often the lock-hold above recurs.

No security, style or docs concerns; the changelog.d/fixed-14606.md fragment is correctly named.

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: pushed review fixes (memoised, time-bounded soft-link lookups) plus the #14667 soft-link binding fix on this branch. CI pending β€” sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: resynced api-reference citations (both red checks shared that drift); CI pending β€” sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: bcad0c9b5

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

@hivecommons-hive hivecommons-hive Bot removed the stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it label Oct 27, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: merged origin/v5 to clear the stage_tracker_test.go conflict (both sides added independent tests; kept both). CI pending β€” sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: da7f1a15d

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

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 27, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 27, 2026
@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 27, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

⏸️ CI is red on the base branch (relative links and anchors resolve); holding until it recovers β€” this is not a failure in this PR, so no fix attempt is counted and no one needs to act here.

@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 27, 2026
hivecommons-hive Bot and others added 3 commits October 27, 2026 17:20
…and state

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com>
…binding uncovered siblings or closed PRs

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Rebased onto v5 to clear the conflict in src/pkg/dashboard/stage_tracker.go, stage_tracker_test.go, server.go, src/docs/api-reference.md. hive/awaiting-ci: CI pending β€” sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 9aed9414a

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

@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 27, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the diff against the v5 tree (stage_tracker.go, advisory_work.go, pr_reference_links.go, callers in stageTrackerPayloadSource) and built pkg/dashboard + pkg/github locally. The code looks correct to me; two things a maintainer should know before merging.

The red check is not this PR's fault. relative links and anchors resolve fails on DRIFT src/docs/scale-envelope.md:37 β†’ client.go:4676-4686 lacks anchor AgeMinutes. This branch's merge-base is c6d82d0; v5 re-anchored that citation in #14712 (d62ef97de). Running python3 src/scripts/check-docs-citations.py src/docs on the PR head reports 1 drift, on v5 0. A merge of v5 clears it; nothing in this diff touches client.go or scale-envelope.md.

Stale prose about the mutex (comment + body), behaviour is fine. stage_tracker.go:1858 says the GETs run "as it holds stageTrackerCacheMu", and the body says the lookups "stay inside the mutex: moving them out would need a rebuild-generation guard". After #14681 that is no longer how the build runs: stageTrackerPayloadSource releases stageTrackerCacheMu before encodeStageTracker (stage_tracker.go:1646–1650) and already has the generation guard (built.stale = s.stageTrackerGen != gen, :1654). So the ≀3 s cold-cache GETs block only the one building request, not the publisher or other /api/stage-tracker readers β€” better than the body claims. Worth rewording the :1858 comment so the next reader does not go looking for a lock that isn't held.

Minor, no action needed:

  • stageTrackerLinkMemo.put (:1897) only evicts expired entries at the 1024 cap, so the map can exceed it if nothing has aged out. Practically bounded by distinct soft-link numbers in the tracker; noting it only because the constant reads as a hard cap.
  • The body's first paragraph says PR-numbered links are "left untouched"; the code drops them (:1954), which the ## Update section and fixed-14667.md describe correctly.

Checked and fine: issueRefPattern (prclaims.go:638) has the two groups prMentionUncovered's index math assumes; deps.GHClient is *ghpkg.Client (deps.go:47) so the new IssueTitleState resolves; TestStageTrackerEnrichSoftLinks exercises the GET path through httptest including the is-PR drop.

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

@hivecommons-hive
hivecommons-hive Bot merged commit 3552a87 into v5 Oct 27, 2026
81 of 85 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-14606 branch October 27, 2026 21:55
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#146309aed941` sha256:2d74983b244ade97dbae402bfccc6300e3d5ba078be236c53116b4a2b5b81040 β€” download from the dashboard or `hivectl review evidence #14630`.

@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 removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off 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

0 participants