Repository navigation
feat(cli): add cleanup downloads command - #8015
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Eviction wrapper and documented behavior src/cli/cleanup/index.ts, src/cli/cleanup/index.spec.ts, docs/tools.md |
cleanupDownloads calls CacheService.evict and returns the evicted paths. It logs when there is nothing to evict and logs the removal count only outside dry-run mode. Documentation describes the cache directory, disk threshold, and dry-run behavior. |
CLI command registration and execution src/cli/command/cleanup-downloads.ts, src/cli/command/index.ts, src/cli/command/cleanup-downloads.spec.ts |
The command passes its dry-run option to cleanupDownloads, logs the outcome and elapsed time, and returns 0 or 1. Tests cover successful execution, dry run, and failures. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant User
participant CleanupDownloadsCommand
participant cleanupDownloads
participant CacheService
User->>CleanupDownloadsCommand: run cleanup downloads
CleanupDownloadsCommand->>cleanupDownloads: pass dry-run flag
cleanupDownloads->>CacheService: evict(dryRun)
CacheService-->>cleanupDownloads: return evicted paths
cleanupDownloads-->>CleanupDownloadsCommand: return paths
CleanupDownloadsCommand-->>User: report outcome and exit code
Possibly related issues
containerbase/base#8013: The PR adds thecleanup downloadssubcommand, but not the aggregate command that runs all three cleanup subcommands.containerbase/base#8027: The PR adds oldest-file eviction. The cache-hit mtime update requested by this issue is not included.
Merge Risk: 
Minimal · up to 28154
-
The cleanup command appears ready to merge after normal checks; no blocking issue was identified.
Pre-merge checks: 
4
-
Full details: Linked Issues check
-
Explanation
Issue
#8012requires acleanup downloadscommand that evicts the oldest files fromCONTAINERBASE_CACHE_DIRuntil usage is belowCONTAINERBASE_MAX_ALLOCATED_DISK. The new command is registered atcleanup downloads.cleanupDownloads()callsCacheService.evict(dryRun), which provides the required cache eviction behavior. The implementation includes automated tests for cleanup, dry-run forwarding, and failure handling.
Full details: Out of Scope Changes check
-
Explanation
The changes stay within issue
#8012. The command implementation, command registration, documentation, and automated tests directly support the cleanup command and its--dry-runoption. No unrelated change is shown.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 @coderabbitai help to get the list of available commands.
efe45c2 to
a6c184c
Compare
b0f7b5c to
5df9a32
Compare
5df9a32 to
28154aa
Compare
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
Co-Authored-By: Claude Opus 5.5 <michael.kriese+claude-code@mend.io>
28154aa to
1bb2fab
Compare
|
🎉 This PR is included in version 14.54.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Changes
containerbase-cli cleanup downloads [--dry-run]command.CONTAINERBASE_CACHE_DIR) until the fill level is belowCONTAINERBASE_MAX_ALLOCATED_DISK, likeinstall-tooldoes after each install.install-tool#4362.Context
Please select one of the following:
cleanup downloadscommand #8012AI assistance disclosure
Did you use AI tools to create any part of this pull request?
Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.
Code, tests and docs by Claude Code (Claude Opus 5.5), reviewed by @viceice.
Use of AI in replying to PR comments
Who answers review comments:
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via:
🤖 Generated with Claude Code
Summary by CodeRabbit
cleanup downloadscommand to remove older cached downloads when disk usage exceeds the configured limit.--dry-runoption to preview the oldest file without deleting it. The cleanup threshold defaults to 100%, and cleanup does nothing when the cache directory is not configured.