Skip to content

Keep only the two newest revision releases of a version - #11

Merged
excid3 merged 1 commit into
mainfrom
prune-old-revisions
Sep 9, 2026
Merged

excid3 merged 1 commit into
mainfrom
prune-old-revisions

Conversation

@excid3

@excid3 excid3 commented Sep 9, 2026

Copy link
Copy Markdown
Member

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_VERSIONS is set.

Change

  • bin/prune-revisions VERSION [--keep N] [--dry-run] deletes a version's oldest revision releases and their tags via gh release delete --cleanup-tag, keeping the newest N. It reads the full release list (drafts excluded), matches only VERSION-<number> tags, and never touches the floating release.
  • publish-release checks 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_REVISIONS at the top of release.yml is the single setting, default 2: the current build plus the previous one for rollback.
  • README and CLAUDE.md describe the policy.

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_REVISIONS if deploys rely on lockfile pinning.

Verification

Dry runs against the live repository: 3.4.8 would drop -1 through -3 and keep the newest two; 1.8.7-p374 --keep 1 and 3.5.0-preview1 match their dashed tags correctly; 4.0.6 with two revisions reports nothing to prune. The script passes bash -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-revisions over 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

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
@excid3
excid3 merged commit baa90da into main Sep 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant