fix: verify failed release rollback head - #10684
Merged
Merged
Conversation
Contributor
Homeboy Results —
|
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.
Summary
Root cause
The checkout guard ran its cleanup commands and returned the final
rev-parsevalue as evidence, but it never compared that observed SHA with the captured original HEAD. Orchestration treated any returned evidence as successful rollback and renderedRelease commit rolled back, so a cleanup mismatch could be presented as restored even when the primary remained on the temporary release commit.Rollback state transitions
captured: record the original ref, original HEAD, and original untracked set before release mutationrestoring: record the release commit, abort in-progress Git operations, clean generated state, and return to the captured refrestored: move to the original HEAD only when the ref still points at the release commit or original HEAD, then independently verifygit rev-parse HEAD == original_headinterrupted: preserve an unexpected concurrently moved HEAD, or report any cleanup/read/verification failure without claiming rollback successEvidence
run.result.rollbacknow reports:status:restoredorinterruptedoriginal_headtemporary_head(retained compatibility field)release_commitfinal_head, populated only by the independent post-cleanup readtag_stateerrorwhen cleanup or verification is incompleterecovery_actionfor interrupted releasesAn interrupted result is forced to failed status and the human summary says
Release commit recovery interruptedwith actual HEAD instead ofrolled back.Concurrent movement
The transaction compares HEAD immediately before the destructive restore. If another actor moved the branch away from both the captured release commit and original HEAD, Homeboy does not overwrite that movement. It records the independently observed final HEAD and reports an interrupted, recoverable release.
Verification
cargo test -p homeboy-release checkout_guard::tests --lib(4 passed)cargo test -p homeboy-release release_summary_ --lib(4 passed)homeboy review lint homeboy --path . --changed-since origin/main --placement local --summary(passed, zero findings, zero formatting drift)homeboy review test homeboy --path . --changed-since origin/main --placement local --json-summary(passed; differential selector found no additional impacted tests)git diff --check(passed)Closes #10676