Repository navigation
π dashboard: show upgrade animation when upgrade is hub-initiated - #12073
Conversation
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>
|
[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
|
|
CI note: |
|
Confirmed the π Hive Agent: β hive: agent=scanner 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 b490738. |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
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.upgradeProgressis 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 viaversionReconcileUpgradeProgress(). A hub-initiated upgrade reaches the browser solely asv.upgradeMarker(the spoke's on-PVC marker written by the heartbeat handler insrc/cmd/hive/main.go) βautoUpdate.state = "retrying", which the frontend used only for status text.Fix (
src/pkg/dashboard/static/index.html)versionAdoptHubUpgradeProgress(v): when there is no local record and/api/versioncarries a live, non-failedupgradeMarkerwhose target differs from the running commit, write it into the progress record withsource: 'hub'andstartedAtfromrequestedAt. Called fromfetchGitVersion()right afterversionReconcileUpgradeProgress(), so all existing bee/navbar/chip rendering is reused unchanged.target|requestedAt|attempts) is remembered inhive.version.upgradeHubAttemptso a dismissed/expired record is not re-shown for the same attempt; a retry (new attempt) is adopted again.versionReconcileUpgradeProgress(): asource: '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.sourceis persisted throughversionWriteUpgradeProgress/versionMarkUpgradeComplete.Tests
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.TestVersionProvenanceRenderingextended: the shippedfetchGitVersion()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/v6has the same code (only atypeofguard differs infetchGitVersion); a v6 PR with the same fix is opened fromfix/hub-upgrade-animation-v6.