fix(deploy): build the previous release so rollback works across a cutover - #408
Merged
Conversation
…tover deploy.sh recorded PREVIOUS_SHA and pointed operators at predeploy_rollback.sh <prev-sha>, but never ensured that release was built. On a first legacy->new cutover the previous (legacy) SHA had no releases/<sha>, so the supported rollback path failed its release_complete guard — surfaced rehearsing the msm-uat cutover. Add a guarded ensure_release "$previous_sha" before the destructive steps: a no-op on a normal deploy (previous release already complete), and on a cutover it builds the old release from the shared repo before the switch, so the rollback target always exists. Fatal if it cannot build — don't cut over without a rollback target. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe deploy script now builds the prior release SHA before per-instance cutover when one exists. The rollback guidance in the docs was updated to describe that behavior. ChangesRollback target provisioning
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This was referenced Jun 26, 2026
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.
Follow-up to #407 (merged). Surfaced while rehearsing the legacy→new cutover on
msm-uat.Problem
deploy.shrecordsPREVIOUS_SHAindeploy-state.envand tells operators to roll back withpredeploy_rollback.sh <inst> <prev-sha>, but it never ensured that previous release was built. On a first legacy→new cutover the previous (legacy) SHA has noreleases/<sha>, sopredeploy_rollback.shfails itsrelease_completeguard — the supported rollback path is impossible on the first cutover. The cutover itself succeeds cleanly; only rollback was broken.Fix
A guarded
ensure_release "$previous_sha"before the destructive steps in the per-instance loop:Docs (
docs/updating.md,scripts/server/README.md) updated.Verification
To be confirmed on the msm-uat rehearsal: reset msm-uat to legacy from the on-disk snapshot, pull this fix, re-run
deploy.sh msm-uat, confirmreleases/<legacy-sha>/.completebuilds automatically during the cutover andpredeploy_rollback.sh msm-uat <legacy-sha>then completes end-to-end. shellcheck clean.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Documentation