feat: allow resuming a partial promote without manual cleanup - #223
Merged
Conversation
When a promote is interrupted mid-way (e.g. the rc.3 stream abort), the target bucket contains some but not all source objects and no .final_status. Re-running the promote previously failed immediately with "FAILED" because the target was not empty, forcing a manual bucket deletion before retry. The new logic distinguishes two cases: - Partial target (files present, no .final_status): records existing files and filters them from the copy loop so only missing objects are copied. - Complete target (.final_status present): fails with a clear message to prevent silent overwrites of a finished promotion. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
LGTM |
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
.final_status. Previously this caused an immediateFAILEDon retry, requiring manual bucket deletion..final_status): records existing files and skips them in the copy loop — only missing objects are transferred..final_statuspresent): rejected immediately withFAILED: target already fully promotedto prevent silent overwrites.Test plan
test_resume_partial_promote— pre-populates 2 of 5 source objects in the target (no.final_status), runs promote, verifies all 5 objects +.final_statusare present in the completed targettest_resume_already_complete_promote— runs a full promote then retries, verifies the retry is rejected with the new error messagetest_copy_fails_when_target_already_exists— updated assertion to match newFAILED: target already fully promotedmessage🤖 Generated with Claude Code