Add retention prune utility for recorded retention-days (#1) #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/1-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
retention-daysis recorded in artifact metadata but never enforced by the upload step, leaving operators on a local directory or a bucket without lifecycle rules no first-party way to expire artifacts (#1). This adds a prune CLI (src/prune.js) that scans the artifacts subtree, reads each.meta.json, computes age from the recordedcreatedAt, and deletes the archive plus sidecar onceretention-dayshas elapsed.remove()and a recursivelistTree()to the local and S3 backends.--dry-runreports without deleting; only entries whose recorded window has elapsed are pruned.createdAt) are skipped, never deleted, unless--force --max-age=<days>supplies a fallback window for record-less entries.configcan resolve the backend without a run id (requireRun: false) so prune scans across all runs under one repo scope.prunenpm script document it.How it was tested
make lintclean (shellcheck/yaml; actionlint and yq not installed locally)make testgreen: 19 tests, including the new prune suite--force --max-age, missing-timestamp skipped, multi-run pass, arg parsing, and a CLI dry-run/real-run subprocess testCHANGELOG updated? yes