fix(r2): abort stale multipart uploads#2303
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 (2)
📝 WalkthroughWalkthroughThis PR adds a multipart upload abortion lifecycle rule to the R2 ChangesR2 Lifecycle Configuration Update
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Merging this PR will not alter performance
Comparing Footnotes
|
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |



Summary (AI generated)
Default Multipart Abort Rule.abortMultipartUploadsTransition.deleted-after-7-days/trash cleanup rule unchanged.Motivation (AI generated)
The bucket already has a 7-day trash cleanup rule for recoverable deletes. The screenshot also shows the default multipart abort rule, and keeping it in the tracked JSON prevents
wrangler r2 bucket lifecycle setfrom accidentally replacing it.Business Impact (AI generated)
This keeps stale multipart upload parts from lingering in R2 while preserving the 7-day recovery window for intentionally trashed bundle objects.
Test Plan (AI generated)
bunx wrangler r2 bucket lifecycle set --helpgit diff --checkbun -e "const fs = require('node:fs'); const config = JSON.parse(fs.readFileSync('cloudflare_workers/r2/lifecycle.capgo.json', 'utf8')); const trash = config.rules.find(rule => rule.id === 'delete-trash-after-7-days'); const multipart = config.rules.find(rule => rule.id === 'Default Multipart Abort Rule'); if (trash?.deleteObjectsTransition?.condition?.maxAge !== 604800) throw new Error('trash maxAge invalid'); if (multipart?.conditions?.prefix !== '') throw new Error('multipart prefix invalid'); if (multipart?.abortMultipartUploadsTransition?.condition?.maxAge !== 86400) throw new Error('multipart maxAge invalid');"bun run cli:buildvia commit hookbun typecheckvia commit hookSummary by CodeRabbit
Documentation
Chores