astral-sh / uv-pre-commit

Apache License 2.0
74 stars 7 forks source link

feat: gracefully handle yanked (head) releases #11

Open CoderJoshDK opened 4 months ago

CoderJoshDK commented 4 months ago

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.

CoderJoshDK commented 4 months ago

Hey, just a reminder of this. It isn't super high priority, obviously. But it would be nice to get the pre-commit tags updated.

zanieb commented 4 months ago

Sorry about the delay this is just kind of a sensitive process to change so I'll need to read it really carefully.

zanieb commented 3 months ago

Just a note that I enabled actions again without this. I still plan on reviewing this though.