Add weekly prune of old -preview package versions - #542
Conversation
|
Update: the 22 private packages have now been flipped to public (all 23 NuGet packages verify as `public` via the API). Billed Packages storage is ~0, so the org is out of the overage. That changes this PR from quota-critical to hygiene: it is no longer needed to get under the limit, but still worth having — ~1,650 per-commit preview versions is unmanageable noise, and any new package will publish as private by default, which is exactly how this went unnoticed. Two corrections to the description above:
|
|
leaving this open for now, I made those packages public so problem solved for now but at some point I'd like to tidy up and have some housekeeping. |
GitHub Packages has no retention-policy feature, and publish-packages-preview.yml pushes the full package set on every `main` commit, so preview versions accumulate without bound. That had reached ~1,650 versions and exhausted the org's shared storage quota. Prunes only `-preview.` versions, keeping the newest 20 per package. GA, `-rc.N`, and legacy `-alpha.N` versions are protected via `ignore-versions` and never touched. Package list is discovered from the API rather than hard-coded, so a newly-added package is covered as soon as it first publishes. Manual runs default to dry-run and emit a per-package report of what would be removed; scheduled runs prune for real. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
cfc81ba to
22a28a6
Compare
|
Reviewed and rebased onto Checked and correct
Changed while rebasing
Follow-ups, not blocking
|
Adds a weekly workflow that prunes old
-previewpackage versions from GitHub Packages, keeping the newest 20 per package.Problem
GitHub Packages has no retention-policy feature. There is no TTL and no auto-expiry.
publish-packages-preview.ymlpushes the full package set on everymaincommit (ADR-0004), so versions accumulate without limit. The feed now holds 2,002 preview versions across 24 packages.Change
Weekly, and on demand, prune keeping the newest 20
-previewversions per package.-rc.Nand legacy-alpha.Nthroughignore-versions. Only per-commit previews are eligible.2026.1.0-preview.<height>and10.0.0-preview.<height>), so a version-number sort would keep the wrong ones.Measured against the live feed: prunes 1,553 versions and leaves 449 previews, plus the 5 protected versions on each package. The largest single-package prune is 71 versions, which is under the action's limit of 100 deletions per run.
Notes
dry-run=truebefore letting the schedule run.version.jsononmainis10.0.0-preview.{height}, somainpublishes10.0.0-preview.18. The preview version went backwards from2026.1.0-preview.156and no longer matches the calendar-version scheme in AGENTS.md and ADR-0004. Worth a separate issue.