Repository navigation
Clean up a failed release so the next dispatch starts clean - #4938
Merged
Merged
Conversation
… input A failed or cancelled release left a tag and attached assets, and the next dispatch failed on both. A new job removes them from a draft, the tag step and the upload steps tolerate leftovers, and the `version` input goes because release-drafter owns the version. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…rrors The `cleanup-failed-release` job now waits for the three reusable build jobs, so their failures trigger it. A missing release or tag is nothing to clean, and any other `gh` failure fails the job, so `notify-failure` alerts. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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.
A failed or cancelled release removes its tag and attached assets, and the next dispatch starts clean. The manual trigger no longer takes a
version.Affects: Automation
Prompt summary: Make the release workflow resilient and clean up after a failed release by removing its artifacts and tag. Remove the
versioninput from the manual trigger, because release-drafter owns the version.Why
The 1.79.0 release failed on the Windows build and left a tag and a draft release with attached assets. Run 44271615615 then failed at
Create tag(Reference already exists), and run 44272054694 failed at everygh release upload(asset under the same name already exists). Recovery took a manual tag delete, a manual delete of 12 assets, and aversioninput (#4935) that lets a dispatcher make up a version.What
Cleanup job
A new
cleanup-failed-releasejob runs when any release job, including the three reusable build jobs, fails or the run is cancelled. It deletes the assets of the draft release and the tag, and keeps the draft, which release-drafter reuses. It exits without changes when the release is published or does not exist, so a published release is never touched. Only an absent release or tag counts as nothing to clean: any othergherror fails the job.notify-failurewaits for it, so a failed cleanup alerts too.Re-dispatch without cleanup
If cleanup did not run, the
Create tagstep still passes. It creates a missing tag, accepts a tag at the right commit, and moves a tag that no published release uses. A new step then deletes any assets on the draft before the build jobs attach new ones, and everygh release uploaduses--clobber.Version input
workflow_dispatchgoes back to no inputs, and the release-drafter step calculates the version again.Risk: The job deletes a tag and release assets, and only from a draft release. After a failure, dispatch the workflow again: "Re-run failed jobs" needs the tag that cleanup removes.
Out of scope: The containers push
edgeandlatestand the Lambdas deploy to prod before the release is published. A re-dispatch pushes and deploys them again, which is acceptable.Verify
The cleanup script was run with a stubbed
ghfor a draft, a published and a missing release, with and without a tag, and with API errors on the release list, the tag lookup and the tag delete. Each error exits 1. Against the published1.80.0and a missing9.9.9it leaves everything alone. The failure path is untested end to end until a release fails or is cancelled.🤖 Generated with Claude Code