Skip to content

πŸ› dashboard: show upgrade animation when upgrade is hub-initiated - #12073

Merged
hivecommons-hive[bot] merged 3 commits into
v5from
fix/hub-upgrade-animation
Oct 15, 2026
Merged

hivecommons-hive[bot] merged 3 commits into
v5from
fix/hub-upgrade-animation

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #12055

cc @kellyaa β€” this was observed on your spoke when @clubanderson launched an upgrade from the hub.

Problem

When an upgrade is launched from the hub, the spoke's Version panel shows Status: upgrade retrying / History: Last upgrade: in progress, but the bee-hive "Upgrading…" animation (sidebar Version block, navbar indicator, version chip) is not shown. The animation only appeared when the upgrade was triggered from inside the spoke via the Version panel button.

Root cause

The bee surfaces render only when ctx.upgradeProgress is non-null, and that record lives in localStorage (hive.version.upgradeProgress). It was only ever written by the local click path (selfUpgrade() β†’ versionRecordUpgradeStart()); fetchGitVersion() only read/validated it via versionReconcileUpgradeProgress(). A hub-initiated upgrade reaches the browser solely as v.upgradeMarker (the spoke's on-PVC marker written by the heartbeat handler in src/cmd/hive/main.go) β†’ autoUpdate.state = "retrying", which the frontend used only for status text.

Fix (src/pkg/dashboard/static/index.html)

  • New versionAdoptHubUpgradeProgress(v): when there is no local record and /api/version carries a live, non-failed upgradeMarker whose target differs from the running commit, write it into the progress record with source: 'hub' and startedAt from requestedAt. Called from fetchGitVersion() right after versionReconcileUpgradeProgress(), so all existing bee/navbar/chip rendering is reused unchanged.
  • The adopted attempt key (target|requestedAt|attempts) is remembered in hive.version.upgradeHubAttempt so a dismissed/expired record is not re-shown for the same attempt; a retry (new attempt) is adopted again.
  • versionReconcileUpgradeProgress(): a source: 'hub' record is cleared when the marker disappears without the target landing (abandoned attempt); the marker target also counts as a known target. Landing β†’ existing "Upgraded to …" complete state β†’ cleared after the usual grace.
  • source is persisted through versionWriteUpgradeProgress / versionMarkUpgradeComplete.
  • Local-trigger behaviour is untouched (a local record is never replaced).

Tests

  • New TestSidebarVersionAdoptsHubInitiatedUpgradeProgress (node): adoption, persistence across polls, landing β†’ complete β†’ clear, no re-show for the same attempt, re-adoption on retry, clear when the marker vanishes, failed/landed markers never adopted, local record left alone.
  • TestVersionProvenanceRendering extended: the shipped fetchGitVersion() with a hub marker renders the navbar bee + menu progress and hides the Upgrade button; a failed marker does not start the animation; dismissal + no re-show.
  • cd src && go build ./... && go test ./pkg/dashboard/... β€” all green (style/tooltip/parity/import ratchets included).

Forward-port

origin/v6 has the same code (only a typeof guard differs in fetchGitVersion); a v6 PR with the same fix is opened from fix/hub-upgrade-animation-v6.

The bee/navbar upgrade progress surfaces were driven only by the
localStorage record written by the local Upgrade button, so an upgrade
launched from the hub (which reaches the dashboard only as
v.upgradeMarker / autoUpdate.state=retrying) showed status text but no
animation.

fetchGitVersion now adopts a live, non-failed upgradeMarker into the
progress record (source 'hub') when no local record exists, so hub- and
locally-triggered upgrades render identically. The adopted attempt key
is remembered so a dismissed/expired attempt is not re-shown, and a
hub-adopted record is cleared when the marker disappears without the
target landing. Local-trigger behaviour is unchanged.

Fixes #12055

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 15, 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 nicholasjackson 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 15, 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 15, 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
#12051 πŸ› fix(automerge): gate contributor-lane unattended merge on vetted identity same files src/pkg/dashboard/static/index.html

@clubanderson

Copy link
Copy Markdown
Member Author

CI note: server-tests (Dashboard Lint) fails here on dashboard/test/throughput-sla.test.js β†’ prtSLATile renders the p50, n, target and a coloured sparkline. This is pre-existing on v5 since b592ab0 (#12053) β€” the same job fails on every v5 push since then (b592ab0, 32fc757, c3035b2, 41a6915). Unrelated to this change; Go ./pkg/dashboard/... is green locally and the v6 twin #12074 passes server-tests. Will rebase once v5 is green.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Confirmed the server-tests failure is the v5 baseline (same test red on v5 HEAD 299f633). Root cause: #12053 prepended two spans to PRT_SLA_SPANS, shifting the positional lookups in throughput-sla.test.js. Fix opened as #12084; once it lands, re-running checks here should go green without changes to this PR.


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

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

@hivecommons-hive
hivecommons-hive Bot merged commit d80ba4c into v5 Oct 15, 2026
59 of 62 checks passed
@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 b490738.

@kubestellar-prow
kubestellar-prow Bot deleted the fix/hub-upgrade-animation branch October 15, 2026 16:26
@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

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.

Upgrade animation not shown when upgrade is hub-initiated

1 participant