fix: pithead upgrade preserves deploy flag; dashboard Workers Alive gap#222
Merged
Conversation
Two bug fixes (the first surfaced reproducing a setup→upgrade loop on the
gouda testbench).
1. `pithead upgrade` no longer un-deploys an already-deployed stack.
stack_upgrade re-renders .env, and render_env writes
DEPLOYMENT_COMPLETED=${DEPLOYMENT_COMPLETED:-false}. load_preserved_state
doesn't carry that flag (unlike the onions/RPC creds/proxy token), so every
upgrade silently rewrote it to false — the next require_deployed command
(up/apply/upgrade) then aborted with "run setup first" and a bare `pithead`
dropped into setup instead of help. upgrade now re-asserts
DEPLOYMENT_COMPLETED=true before the render, mirroring apply; it's only
reached past require_deployed, so the stack is deployed by definition. Added
a black-box regression test that fails on the old code.
2. Dashboard "Workers Alive" panel now has the standard gap beneath it. It was
the one top-level section rendered as a bare .card instead of being wrapped
in .grid (which supplies the consistent 20px bottom margin), so the space
below it collapsed to zero. Now wrapped in .grid like the chart above it.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Two bug fixes. The first surfaced while reproducing a
git pull → pithead setup → pithead upgradeloop on the gouda testbench; the second is the inconsistent gap below the dashboard Workers Alive panel.1.
pithead upgradeno longer un-deploys an already-deployed stackstack_upgradere-renders.envon every run, andrender_envwritesDEPLOYMENT_COMPLETED=${DEPLOYMENT_COMPLETED:-false}. Butload_preserved_stateonly carries the Tor onions, RPC creds, and proxy token — notDEPLOYMENT_COMPLETED— so the shell variable was unset and eachupgradesilently rewrote the flag tofalse.Blast radius (since
is_deployedis justgrep -q "^DEPLOYMENT_COMPLETED=true"):require_deployedcommand (up/apply/ anotherupgrade) aborts with "The stack isn't fully set up yet — run setup first"pitheaddrops intosetupinstead of showing helpdoctornags "DEPLOYMENT_COMPLETED is not true… Run 'pithead setup'"…which forces a needless, heavyweight
setup(Tor re-provision, GRUB edit) before every upgrade.Reproduced on gouda with the exact commands: flag went
true→ runupgrade→ flag came backfalse.Fix:
upgradenow re-assertsDEPLOYMENT_COMPLETED=truebefore the render, mirroring whatapplyalready does. It's only ever reached pastrequire_deployed, so the stack is deployed by definition. Covered by a new black-box regression test in the existing#128upgrade block (verified to fail on the old code, pass on the fix).2. Dashboard "Workers Alive" panel had no bottom gap
Every dashboard section is a
.cardwrapped in a.grid, and.gridsupplies the consistent20pxbottom margin between sections.WorkersTablewas the one top-level section rendered as a bare.cardwith no.gridwrapper, so the space below it collapsed to0— out of step with the rest of the layout. Now wrapped in.gridexactly like theChartCardabove it.Related issue
No pre-existing issues — both are newly found. (Searched open issues; nearest are #59/#104, unrelated.)
Checklist
make testpasses locally (lint + dashboard pytest ≥ coverage gate +pitheadshell suite + compose validation + selftest + fakes)pitheadand test scripts are shellcheck-clean (no new warnings)This PR is focused on a single logical change— two small fixes bundled into one PR by requestTest evidence
pitheadshell suite: 252 passed, 0 failed (incl. newupgrade preserves DEPLOYMENT_COMPLETEDassertion)make test: green through all stages🤖 Generated with Claude Code