Make the release step safe to re-run - #14
Merged
Merged
Conversation
Two gems push in sequence, so there is a half-done state: the runtime goes up, the generator fails, and the tag is stuck. Re-running used to die on the first push, because RubyGems will not accept a version twice, so the retry could never reach the gem that actually needed it. Each push now asks whether that exact version is already on RubyGems and skips it if so, which makes a re-run finish what the first attempt started. Any answer other than 200 or 404 fails the job rather than guessing, since a push decided by a timeout is worse than one that stops.
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.
Publishing two gems in sequence has a half-done state: the runtime goes up, the generator fails, and re-running the job dies on the first push, because RubyGems will not accept a version twice. The tag is then stuck unless you bump it.
Each push now asks whether that exact version is already on RubyGems and skips it if so, so a re-run finishes what the first attempt started. Any answer other than 200 or 404 fails the job rather than guessing.
Verified against the live API using the tag just shipped — both already published (skip), a fresh version (push), and the half-published case (skip one, push the other).