fix: images clean matches registry tags, not capy prefix - #99
Merged
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesRegistry-driven image cleanup
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant images_clean
participant ImageRegistry
participant Docker
User->>images_clean: clean --all [--registry]
images_clean->>ImageRegistry: resolve and load image-registry.yml
ImageRegistry-->>images_clean: docker_tag values
images_clean->>Docker: list installed tags
images_clean->>Docker: remove matching tags
Docker-->>images_clean: removal result
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
bradjin8
reviewed
Jul 30, 2026
bradjin8
approved these changes
Jul 30, 2026
wpak-ai
approved these changes
Jul 30, 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.
Closes #98
images clean --all used to drop anything that did not start with capy-ubuntu-, so generic-profile images like ubuntu-latest-gcc15:latest never got removed even when they were in image-registry.yml.
It now loads the registry (same resolution as list and build), intersects installed repo:tag strings with registry docker_tag values, and only removes those matches. --registry is available on clean for parity with the other images subcommands.
Tests cover generic and Capy tags, dry-run, empty intersection, cwd registry discovery, and a capy-prefixed orphan tag that the old prefix filter would have removed incorrectly.
Run pytest tests/test_images_paths.py -k clean or tag a stand-in image and try localci images clean --all --dry-run.
Summary by CodeRabbit
New Features
localci images cleanvia--registry/-r.Bug Fixes
Tests
--allfailure case when no registry can be resolved.