Add cache retention and prune utility (#4) #8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/4-retention-prune"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What changed
The action never evicts on its own and there is no per-cache size cap, so operators with no storage lifecycle rule (or using the filesystem backend) have no first-party way to reclaim space (#4). Adds a prune utility that scans the configured store, deletes entries past a retention horizon, and removes each archive together with its
.sha256sidecar. It runs as theprunesub-action or asnode src/prune.js, against the sameRASTER_CACHE_*backend as restore and save.--max-age(delete entries older than30d/168h/90m/seconds) and--max-bytes(keep the newest entries up to a total size cap, prune the rest).--dry-runchanges nothing, and a run with no policy is refused outright rather than treated as "delete everything".--forceis given..sha256sidecar are always pruned together; the sidecar's bytes count toward the size cap.remove()and a recursivelistTree()to both backends (S3 reuses the flat ListObjectsV2; local gets a tree walk), plus DELETE support in the S3 mock.How it was tested
make lintclean (actionlint/yq absent locally and skipped; new YAML parsed separately)make testgreen (78 tests)--force),max-byteskeeps the newest under the cap, age+size union, archive+sidecar deleted together on both the local backend and the S3 mock, backendlistTree/remove, duration/size parsing, plus CLI coverage (--help, no-policy failure, dry-run vs real)CHANGELOG updated? yes