Add weekly prune of old -preview package versions - #542
Conversation
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>
|
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. |
The org ran out of shared storage. Cause is GitHub Packages, not Actions artifacts.
Problem
GitHub Packages has no retention-policy feature — no TTL, no auto-expiry, nothing to configure.
publish-packages-preview.ymlpushes the full package set on everymaincommit (ADR-0004), so versions accumulate without bound. Current state: 23 packages × ~72 versions ≈ 1,650 versions.Only private packages are billed. 22 of the 23 are private (~885 MB) against a 500 MB free-plan quota — 1.8× over.
Fallout.Commonalone is 646 MB of it.Actions artifacts are not implicated: 30 MiB total, and the one uploader already sets
retention-days: 7.Change
Weekly (+ on-demand) prune keeping the newest 20
-previewversions per package.-rc.N, and legacy-alpha.Nviaignore-versions— verified against the live feed, only previews are eligible.Effect: prunes 1,098 versions, private storage ~885 MB → ~270 MB, back under quota.
Notes
dry-run=truebefore letting the schedule run.Fallout.GlobalToolsis already public, which is why its 1.3 GB costs nothing). Visibility is UI-only per package, so it is not scriptable here.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 CalVer scheme documented in AGENTS.md / ADR-0004. Worth a separate issue.