Repository navigation
Keep only the two newest revision releases of a version - #11
Merged
Merged
Conversation
Every rebuild left another pinned revision release behind, most versions had five or six, and nothing used any but the newest: mise resolves the newest revision or the floating tag, and the build fingerprint lives in the newest revision's notes. Hundreds of releases also push versions out of the first page of the release list, which is all mise reads by default. bin/prune-revisions deletes a version's oldest revision releases and their tags, keeping the newest KEEP_REVISIONS (2: the current build and the previous one, so a bad rebuild can be rolled back by re-pointing the floating release). publish-release runs it last, after the floating release points at the new build. The floating release is never pruned. Claude-Session: https://claude.ai/code/session_01KeNcsk8V24YRXGfD2HwDZY
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.
Problem
Every rebuild leaves another pinned revision release behind. Most versions have five or six, each holding about 200 MB of tarballs, and nothing uses any but the newest: mise resolves the newest revision or the floating tag, and the build fingerprint (#9) lives in the newest revision's notes. Hundreds of releases also push versions out of the first page of the release list, which is all mise reads unless
MISE_LIST_ALL_VERSIONSis set.Change
bin/prune-revisions VERSION [--keep N] [--dry-run]deletes a version's oldest revision releases and their tags viagh release delete --cleanup-tag, keeping the newest N. It reads the full release list (drafts excluded), matches onlyVERSION-<number>tags, and never touches the floating release.publish-releasechecks out the repo and runs it as its last step, after the floating release has been re-pointed at the new build, so the revision being served is never a candidate for deletion.KEEP_REVISIONSat the top ofrelease.ymlis the single setting, default2: the current build plus the previous one for rollback.Caveat
A mise lockfile that pins a pruned revision URL falls back to the newest revision with a debug message rather than failing, so installs keep working but the pinned build changes. Raise
KEEP_REVISIONSif deploys rely on lockfile pinning.Verification
Dry runs against the live repository:
3.4.8would drop-1through-3and keep the newest two;1.8.7-p374 --keep 1and3.5.0-preview1match their dashed tags correctly;4.0.6with two revisions reports nothing to prune. The script passesbash -n; the workflow YAML parses. The step itself runs for the first time on the next release after merge.Backlog
Existing versions still carry their old revisions until each is released again. A one-time pass,
bin/prune-revisionsover every recipe version, brings the repository down to about 170 releases; I'd run it once today's batch has finished.https://claude.ai/code/session_01KeNcsk8V24YRXGfD2HwDZY