Skip to content

fix: pithead upgrade preserves deploy flag; dashboard Workers Alive gap#222

Merged
VijitSingh97 merged 1 commit into
mainfrom
claude/festive-wilbur-3f1f36
Jun 11, 2026
Merged

fix: pithead upgrade preserves deploy flag; dashboard Workers Alive gap#222
VijitSingh97 merged 1 commit into
mainfrom
claude/festive-wilbur-3f1f36

Conversation

@VijitSingh97

Copy link
Copy Markdown
Collaborator

What & why

Two bug fixes. The first surfaced while reproducing a git pull → pithead setup → pithead upgrade loop on the gouda testbench; the second is the inconsistent gap below the dashboard Workers Alive panel.

1. pithead upgrade no longer un-deploys an already-deployed stack

stack_upgrade re-renders .env on every run, and render_env writes DEPLOYMENT_COMPLETED=${DEPLOYMENT_COMPLETED:-false}. But load_preserved_state only carries the Tor onions, RPC creds, and proxy token — not DEPLOYMENT_COMPLETED — so the shell variable was unset and each upgrade silently rewrote the flag to false.

Blast radius (since is_deployed is just grep -q "^DEPLOYMENT_COMPLETED=true"):

  • the next require_deployed command (up / apply / another upgrade) aborts with "The stack isn't fully set up yet — run setup first"
  • a bare pithead drops into setup instead of showing help
  • doctor nags "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 → run upgrade → flag came back false.

Fix: upgrade now re-asserts DEPLOYMENT_COMPLETED=true before the render, mirroring what apply already does. It's only ever reached past require_deployed, so the stack is deployed by definition. Covered by a new black-box regression test in the existing #128 upgrade 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 .card wrapped in a .grid, and .grid supplies the consistent 20px bottom margin between sections. WorkersTable was the one top-level section rendered as a bare .card with no .grid wrapper, so the space below it collapsed to 0 — out of step with the rest of the layout. Now wrapped in .grid exactly like the ChartCard above it.

Related issue

No pre-existing issues — both are newly found. (Searched open issues; nearest are #59/#104, unrelated.)

Checklist

  • make test passes locally (lint + dashboard pytest ≥ coverage gate + pithead shell suite + compose validation + selftest + fakes)
  • pithead and test scripts are shellcheck-clean (no new warnings)
  • Docs unchanged — both are bug fixes that restore intended behavior; no documented behavior changes
  • This PR is focused on a single logical change — two small fixes bundled into one PR by request
  • No linked issue — newly-found bugs, filed directly as fixes

Test evidence

  • pithead shell suite: 252 passed, 0 failed (incl. new upgrade preserves DEPLOYMENT_COMPLETED assertion)
  • Dashboard frontend logic: 32 passed, 0 failed
  • Full make test: green through all stages

🤖 Generated with Claude Code

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>
@VijitSingh97
VijitSingh97 merged commit b7c7e96 into main Jun 11, 2026
12 checks passed
@VijitSingh97
VijitSingh97 deleted the claude/festive-wilbur-3f1f36 branch June 11, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant