Skip to content

🐛 Overview: say "refreshing after restart · N/M repos scanned" instead of "stale since <previous pod>" - #15162

Merged
hivecommons-hive[bot] merged 4 commits into
v5from
fix/overview-stale-restart
Oct 28, 2026
Merged

hivecommons-hive[bot] merged 4 commits into
v5from
fix/overview-stale-restart

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #15161

After a rollout the governor serves the snapshot restored from /data/last-actionable.json (marked stale via MarkAllStale, 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 by bootCollectors on the restored copy only; a fresh enumeration result never carries it.
  • FrontendStatus.RestartRefresh (restartRefresh): {restoredAt, snapshotAt, reposScanned, reposTotal}, set by restartRefreshInfo while the published snapshot is the restored stale one; nil otherwise, so it clears with staleSince.
  • SPA: 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.
  • Tests: TestRestartRefreshInfo_StaleToFreshAcrossRestart (restored → re-marked → fresh → later refusal → partial tally, no sleeps) and node fixture TestOverviewStaleBadgeWordsRestartWindow.
  • docs/api-reference.md line citations refreshed by check-api-reference-citations.sh --fix.

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

github-actions Bot commented Oct 28, 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
#15104 🐛 Activity Monitor: Rebase, then merge as maintainer; fixer owns parked conflicting PRs; dismiss self-inflicted changes_requested same files src/pkg/dashboard/server.go
src/pkg/dashboard/static/index.html
#15157 ✨ Conflict-aware merge train in the automerge lanes same files src/cmd/hive/main.go
src/pkg/dashboard/static/index.html
#15118 🐛 fix: open the needs-human popover on issue rows with a parked PR same files src/pkg/dashboard/static/index.html
#15150 🐛 Activity Monitor: persist the merged count in a server ledger, pin the Merged chip, banner and bee flight on merge same files src/docs/api-reference.md
src/pkg/dashboard/server.go
src/pkg/dashboard/static/index.html
#15149 ✨ feat(automerge): pick one merge-train front per group of file-overlapping approved PRs same files src/cmd/hive/main.go
#15163 ✨ feat(hub): surface "Pause hive" in the hub spoke dropdown menu same files src/cmd/hive/main.go
src/docs/api-reference.md
#15105 ✨ feat(hub): surface "Pause hive" in the hub spoke dropdown menu same files src/cmd/hive/main.go
src/docs/api-reference.md
#15156 🐛 Activity Monitor: an owner's Approve admits the untrusted-author PR head — no adoption, merge as-is; DCO warned before acting same files src/pkg/dashboard/static/index.html
#15122 🐛 Write-back containment: per-kind gate for every unsolicited GitHub write, with backfill guard CONFLICT src/docs/api-reference.md
#14807 ✨ dashboard: stream Job pod logs in the terminal pane for sandbox.runtime: job agents same files src/docs/api-reference.md
src/pkg/dashboard/server.go
src/pkg/dashboard/static/index.html
src/pkg/dashboard/status_builder.go
#15085 ✨ Activity Monitor: Adopt now and Reroute to another clanker for PRs waiting on a contributor's clanker same files src/cmd/hive/main.go
src/pkg/dashboard/server.go
src/pkg/dashboard/static/index.html
#15134 🐛 Delegated decision on a capability gap: model the blocker, stop the un-park/re-park loop, name the missing App permission same files src/docs/api-reference.md
src/pkg/dashboard/server.go
src/pkg/dashboard/static/index.html

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 28, 2026
@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 hivecommons-hive Bot added author/human A person pushed this PR themselves 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/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act labels Oct 28, 2026
@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.

Failing checks:

  • relative links and anchors resolve

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>
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act labels Oct 28, 2026

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

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

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) counts ReposScanned from !r.CountsStale, and CountsStale is set true for every repo in actionable.StaleRepos (status_builder.go:2505-2508; applyForgeOpenCounts at :2321 only ever sets it true).
  • MarkAllStale (webhook_item_patch.go:270-283) puts every repo in TotalByRepo into StaleRepos. The only writers of StaleRepos in non-test code are that function, Clone (:229, a copy), and the enumeration at client.go:1700 on a new result. No path removes one repo from the restored snapshot's StaleRepos while RestoredAt is set.
  • So the "2/3" case in TestRestartRefreshInfo_StaleToFreshAcrossRestart step 5 (overview_restart_refresh_test.go:89-96) is reachable only by hand-editing partial.StaleRepos; the node fixture's 5/10 is 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 in StaleRepos and 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

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 3976265 into v5 Oct 28, 2026
81 of 84 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/overview-stale-restart branch October 28, 2026 23:35
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#151622e52ac8` sha256:59a8b3a3f0da9f950f8695130c743d5fd22741c464061435437d2b7f788d17d1 — download from the dashboard or `hivectl review evidence #15162`.

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

@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/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/human A person pushed this PR themselves conflicts-with-open-pr Open PR has a merge conflict with another open PR 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

Development

Successfully merging this pull request may close these issues.

🐛 Overview says "stale since <previous pod's time> (1h ago)" for ~15 min after every restart

1 participant