CD hardening: rollback on failed dev deploy; define the prod deploy path (tag-triggered or documented) #66

Closed
opened 2026-07-18 05:31:29 +00:00 by claude-bot · 1 comment
Contributor

cd.yml:54-76 deploys dev by SSH pull + rebuild + 40s health poll; a failed
migration or crash loop leaves dev down with no rollback. Capture the
previously deployed ref before pulling; on health timeout, restore it and
rebuild (and fail the run loudly). Separately: #12's candidate scope included
prod deploy on tag/release — never delivered, and with docs/HANDOFF.md
retired (#38) the manual prod procedure is no longer written anywhere. Either
add a tag-triggered prod job with an approval gate, or at minimum document
the manual prod deploy + rollback procedure in README.

Acceptance criteria:

  • Failed dev deploy automatically restores the previous working ref
  • Prod deploy path exists in code or docs (decision recorded)

Filed from the 2026-07-17 codebase audit (docs/.internal/report-2026-07-17.md), finding F-27.

cd.yml:54-76 deploys dev by SSH pull + rebuild + 40s health poll; a failed migration or crash loop leaves dev down with no rollback. Capture the previously deployed ref before pulling; on health timeout, restore it and rebuild (and fail the run loudly). Separately: #12's candidate scope included prod deploy on tag/release — never delivered, and with docs/HANDOFF.md retired (#38) the manual prod procedure is no longer written anywhere. Either add a tag-triggered prod job with an approval gate, or at minimum document the manual prod deploy + rollback procedure in README. **Acceptance criteria:** - [ ] Failed dev deploy automatically restores the previous working ref - [ ] Prod deploy path exists in code or docs (decision recorded) --- _Filed from the 2026-07-17 codebase audit (`docs/.internal/report-2026-07-17.md`), finding F-27._
Author
Contributor

Done in #95 (merged to main). cd.yml now captures the currently-deployed commit before pulling and, if the post-deploy health check fails, checks that ref back out, rebuilds, and fails the run — so a bad migration or crash-loop restores the dev box to the last-working build instead of leaving it mid-deploy. The happy path is unchanged. README gained a manual Production deploy section (checkout tag → build with APP_VERSION → migrations run on startup → health check → redeploy previous tag to roll back). Automated prod-on-tag deploy remains a future enhancement — deliberately not built, since no prod host/secrets are assumed here.

Done in #95 (merged to `main`). `cd.yml` now captures the currently-deployed commit before pulling and, if the post-deploy health check fails, checks that ref back out, rebuilds, and fails the run — so a bad migration or crash-loop restores the dev box to the last-working build instead of leaving it mid-deploy. The happy path is unchanged. README gained a manual **Production deploy** section (checkout tag → build with `APP_VERSION` → migrations run on startup → health check → redeploy previous tag to roll back). Automated prod-on-tag deploy remains a future enhancement — deliberately not built, since no prod host/secrets are assumed here.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/WeatherBot#66
No description provided.