BUILD-10739 Cache cleanup with list and delete modes#43
Conversation
12ba6f8 to
f12bcfc
Compare
f12bcfc to
ce47e17
Compare
SummaryRewrites cache cleanup from simple What reviewers should knowStart with: Key changes to review:
Gotchas:
|
There was a problem hiding this comment.
The pagination bug is the main concern — it could cause silent data loss in delete mode on busy repos. The table duplication is straightforward to fix with a helper function.
Conclusion: Two issues need fixing before merge: a real bug (truncated S3 listing) and new logic duplication introduced by this commit. The key-filter duplication flagged in the previous review (comment #2953033147) also remains unaddressed.
cd26e9c to
deb8385
Compare
SonarQube reviewer guide
|
9e32862
into
master
SonarQube reviewer guide
|




Summary
Rewrites the cache cleanup script to use a two-phase approach with list and delete modes:
Changes
scripts/cleanup-cache.sh: Replacedaws s3 rm --include/--excludewithaws s3api list-objects-v2+grepfiltering +aws s3api delete-objectsbatch deletion (up to 1000 objects per API call)cleanup/action.yml: Madebranchinput optional to support list mode.github/workflows/cleanup-cache.yml: Updated inputs to match (branch optional, descriptions updated)README.md: Rewrote Cache Cleanup section with usage table showing all scenarios.github/workflows/test-action.yml: Removed test-cleanup-dry-run job (tested manually, requires IAM changes to work in CI)How users interact
sccache-Linux-feature/my-branchtruefeature/my-branchfalseDependencies
Requires IAM policy changes in github-runners-infra PR to grant
s3:ListBucketands3:DeleteObjectforworkflow_dispatchfrom protected branches.Test plan
S3_BUCKET=sonarsource-s3-cache-dev-bucket GITHUB_REPOSITORY=SonarSource/gh-action_cache bash scripts/cleanup-cache.shCLEANUP_KEY=git-clean-testCLEANUP_BRANCH=feat/... DRY_RUN=true🤖 Generated with Claude Code