fix: wire real rollback_sha into hotfix auto-rollback (#108) - #155
Merged
Merged
Conversation
The hotfix context job was emitting rollback_sha= (empty), causing the rollback-<deploy> gate to never fire. Wire in the target env's pre-hotfix state SHA from the manifest using yq, matching the N-1 pattern from promote. Release has no deploy jobs and needs no rollback; documented with a code comment in writeJobs. Hotfix auto-rollback is always-on when an N-1 SHA exists. Unlike promote, hotfix has no preflight job to carry an explicit rollback_on_failure signal; adding a new knob is out of scope and always-on matches the inherent N-1 model. Addresses #108 item 1 (hotfix rollback_sha placeholder) Signed-off-by: Joshua Temple <joshua.temple@stablekernel.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.
Problem
Auto rollback-on-failure works in promote but is a dead stub in hotfix. The generated hotfix workflow declares a rollback_sha output and a correctly-gated rollback- job, but the context job echoed rollback_sha= empty, so the gate (rollback_sha != "" && deploy failure) never fired. This is the placeholder noted in #108 item 1.
Fix
The hotfix context job now sources a real pre-hotfix SHA, mirroring promote (RollbackSHA = state.SHA = N-1):
The rollback- gate is unchanged and now reachable. A first-ever hotfix into a fresh env has no N-1 SHA, so rollback_sha stays empty and the gate correctly skips - the gate is self-limiting. Hotfix auto-rollback is intentionally always-on when an N-1 SHA exists: the hotfix workflow has no preflight job to carry a rollback_on_failure signal, so wiring an explicit opt-in input is out of scope; documented in a code comment.
Release case
The release workflow tags, generates the changelog, and publishes a GitHub release. It performs no environment deploy, so there is no deploy to auto-roll-back. No rollback job is invented; the absence is documented in a code comment before writeJobs.
Verification
Addresses #108 item 1 (the hotfix rollback_sha placeholder). Additive and non-breaking: promote rollback behavior is unchanged.