Repository navigation
🐛 Overview: say "refreshing after restart · N/M repos scanned" instead of "stale since <previous pod>" - #15162
Conversation
… restart After a restart the governor serves the snapshot restored from /data/last-actionable.json, marked stale with StaleSince = the previous process's GeneratedAt, until its first enumeration completes (~12-15 min on a 10-repo hive). The Overview rendered that as "stale since <previous pod's time> (1h ago) · serving last-good", which reads as an hour-old outage when the real state is "restarted 12m ago, first scan running". Mark the restored snapshot with RestoredAt, publish it as status.restartRefresh (restore time, snapshot read time, repos scanned / total) while that snapshot is still the stale one, and have the badge and sidebar pill read "refreshing after restart (<n>m ago) · N/M repos scanned · showing snapshot from <t>". A fresh enumeration carries no RestoredAt, so the marker clears with the badge; a later GitHub refusal keeps the original wording. Fixes #15161 Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
[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 |
Generated by changelog-fragment-guard from the PR title (#5675). Edit the wording freely, or replace this file with the no-changelog label if the change is not user-visible. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: clubanderson <407614+clubanderson@users.noreply.github.com>
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
@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. |
|
@clubanderson this PR is held at Failing checks:
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. |
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
There was a problem hiding this comment.
Looks correct to me; one observation, not a blocker.
Verified the lifecycle of RestoredAt: it is set only on the disk-restored snapshot (src/cmd/hive/main.go:3206), survives webhook upserts because Clone() is a value copy (src/pkg/github/webhook_item_patch.go:222), and is never set on a result built by a real enumeration (src/pkg/github/client.go:1680-1697), so restartRefreshInfo (status_builder.go:2261) goes nil as soon as the first enumeration publishes — matching the changelog's "clears with the first completed enumeration".
Observation: a first enumeration that has to carry last-good counts for some repos sets StaleRepos (client.go:1694) but no RestoredAt, so for that window the badge reverts to ⚠ stale since <previous process time> rather than refreshing after restart · N/M repos scanned. That reading is accurate (those repos' data is from the previous process), so I'd leave it; mentioning it only so nobody files it as a regression later.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
The core change is sound: RestoredAt is stamped only in bootCollectorsWith (src/cmd/hive/main.go:3206), the fresh enumeration result is a new struct (src/pkg/github/client.go:1700 sets StaleRepos on result, never touching RestoredAt), and publishEnumeratedSnapshot CAS-swaps that new pointer in (eval_cycle_source.go:153-170), so the marker disappears with the first successful pass. Clone (webhook_item_patch.go:222) copies the whole struct, so webhook patches during the window keep it. keepLastGoodAfterFailedEnumerate keeps the restored copy, which is still correctly "restored". Step 4 of the new test (post-restart refusal → nil) matches that.
One finding (medium): the N/M repos scanned tally cannot advance in production — it always reads 0/M until the window closes.
restartRefreshInfo(src/pkg/dashboard/status_builder.go:2261-2279) countsReposScannedfrom!r.CountsStale, andCountsStaleis set true for every repo inactionable.StaleRepos(status_builder.go:2505-2508;applyForgeOpenCountsat:2321only ever sets it true).MarkAllStale(webhook_item_patch.go:270-283) puts every repo inTotalByRepointoStaleRepos. The only writers ofStaleReposin non-test code are that function,Clone(:229, a copy), and the enumeration atclient.go:1700on a new result. No path removes one repo from the restored snapshot'sStaleReposwhileRestoredAtis set.- So the "2/3" case in
TestRestartRefreshInfo_StaleToFreshAcrossRestartstep 5 (overview_restart_refresh_test.go:89-96) is reachable only by hand-editingpartial.StaleRepos; the node fixture's5/10is likewise synthetic. Operators will see⟳ refreshing after restart (12m ago) · 0/10 repos scanned · …for the whole 12–15 min window, which reads as "nothing has happened" — the opposite of the reassurance the PR body describes. - Minor corollary: a repo added to config after the snapshot was written is absent from
TotalByRepo, so it is not inStaleReposand is counted as "scanned" before anything has read it.
Suggested direction: either drop the N/M segment (keep "refreshing after restart (12m ago) · showing snapshot from ", which is what the code can actually substantiate), or make the first enumeration publish per-repo progress onto the restored snapshot (remove from StaleRepos as each repo's listing lands) so the counter means something. Not a defect in what does render — just the headline promise of the title/body isn't delivered by the code.
Also noting the conflicts-with-open-pr label; I have not checked which PR it overlaps. I have not approved or requested changes as a review event.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 2e52ac8. |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Fixes #15161
After a rollout the governor serves the snapshot restored from
/data/last-actionable.json(marked stale viaMarkAllStale,StaleSince = previous GeneratedAt) until its first enumeration publishes — ~12–15 min on the hosted 10-repo spoke. The Overview rendered that as ⚠ stale since 5:15 PM (1h ago) · serving last-good twelve minutes after the restart.Change
github.ActionableResult.RestoredAt: stamped bybootCollectorson the restored copy only; a fresh enumeration result never carries it.FrontendStatus.RestartRefresh(restartRefresh):{restoredAt, snapshotAt, reposScanned, reposTotal}, set byrestartRefreshInfowhile the published snapshot is the restored stale one; nil otherwise, so it clears withstaleSince.overviewStaleBadgeText— in the restart window the badge and sidebar-pill title read ⟳ refreshing after restart (12m ago) · 5/10 repos scanned · showing snapshot from ; a genuine GitHub refusal in a running process keeps ⚠ stale since · serving last-good. Per-repo KPI scope ignores the server-wide window.TestRestartRefreshInfo_StaleToFreshAcrossRestart(restored → re-marked → fresh → later refusal → partial tally, no sleeps) and node fixtureTestOverviewStaleBadgeWordsRestartWindow.docs/api-reference.mdline citations refreshed bycheck-api-reference-citations.sh --fix.