Skip nightly cleanup when only the dev tag exists#1350
Merged
Conversation
GHCR refuses to delete a package's last remaining tagged version
("You must delete the package instead"). A package that has only
ever had nightly dev builds (e.g. right after an image rename, before
its first real release) has no other tag to fall back on, so the
existing cleanup-images job fails when it tries to delete that sole
0.0.0-dev-* tag.
Add a check step, alongside the existing package-existence probe,
that lists a package's tags and skips the delete step when every tag
matches the dev pattern being removed. Cleanup resumes automatically
once the package has a real release tag to anchor on.
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe nightly cleanup workflow now checks GHCR package tags before deleting ChangesGHCR cleanup safeguard
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
AnoshanJ
approved these changes
Jul 18, 2026
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.
Purpose
The nightly "Cleanup Previous Nightly Images" job fails for
amp-observer(see this run) with:You cannot delete the last tagged version of a package. You must delete the package instead.amp-observerwas recently renamed fromamp-traces-observerand has never been through a real release, so its only tag is the nightly0.0.0-dev-*build the cleanup step is trying to delete, and GHCR refuses to remove a package's last remaining tag.Goals
Skip the delete step (with a warning annotation) when a package's only existing tags are the
0.0.0-dev-*tags about to be removed, instead of failing the job. Cleanup resumes automatically once the package has a real release tag to anchor on.Approach
Added a
check-tagsstep alongside the existing package-existence probe incleanup-images. It lists a package's tags viagh api .../versions --paginateand compares the total tag count against the count matching the0.0.0-dev-*pattern. If every existing tag is a dev tag, it setsskip=true, and the delete step'sif:condition now also checks that output before running.User stories
N/A - CI/ops-only change, no user-facing behavior.
Release note
Fix nightly image cleanup so it no longer fails for packages that only have nightly dev tags and no release tag yet.
Documentation
N/A - internal CI workflow change only, no product documentation impact.
Training
N/A - no training content affected.
Certification
N/A - no certification exam impact.
Marketing
N/A - internal CI fix, nothing user-facing to promote.
Automation tests
N/A - GitHub Actions workflow change, no unit test harness applies.
Verified against the failing run's logs that
amp-observercurrently has exactly one tagged version (the dev tag) versus zero for every other tag category, confirming the new check would setskip=truefor it. Will also observe the next scheduled nightly run to confirm the job goes green.Security checks
Samples
N/A - no sample changes.
Related PRs
N/A
Migrations (if applicable)
N/A - no data or schema migrations.
Test environment
N/A - GitHub Actions workflow; verified via
gh run viewlog inspection, no separate test environment applicable.Learning
Compared the failing
amp-observerpackage's tag list (only0.0.0-dev-*) against a package with full release history (amp-console, which retainsv0.18.0etc.), and tracedamp-observer's package name to a recent rename (agent-manager-observer, commit 27ea5ee) that post-dates the last release cut (v0.18.0).Summary by CodeRabbit