feat: gracefully handle yanked (head) releases #11
+65
−36
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.
Closes #10
This PR fixes the issue with yanked releases. It handles the case where the latest version is the yanked version (the main issue with #9).
The first change is in the GitHub action. Instead of doing the pushes and releases in the action itself, they are being done in the python script (
mirror.py
)This has the side effect of fixing 2 bugs. If multiple releases happened in the CRON window, a tag for each would not be created, and the tagged version would be wrong. This is no longer the case.
A release is considered
yanked
if any of its artifacts are marked as yanked. Some things to keep in mind:If a release is yanked before any action is run, it won't have a tag created for it.
If the most recent tag is a yanked version, a new commit will be created that sets the version to the most recent valid version → deletes that tagged release → create it again. This will force the
FETCH_HEAD
tag to be pointing to a valid head.Note
If 1.0 is good and 1.1 is bad, and the client already fetched both 1.0 and 1.1; they must delete 1.0 to be able to fetch its replacement.
This is an edge case on an edge case.