Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/short-toes-dig.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"wrangler": minor
---

Add interactive data catalog validation to R2 object and lifecycle commands.

When performing R2 operations that could affect data catalog state (object put, object delete, lifecycle add, lifecycle set), Wrangler now validates with the API and prompts users for confirmation if a conflict is detected. For bulk put operations, Wrangler prompts upfront before starting the batch. Users can bypass prompts with `--force` (`-y`). In non-interactive/CI environments, the operation proceeds automatically.
6 changes: 6 additions & 0 deletions packages/wrangler/src/__tests__/r2/bulk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ describe("r2", () => {
Resource location: remote

Starting bulk upload of 2 objects to bucket bulk-bucket using a concurrency of 20
? Bulk upload may overwrite existing objects. If this bucket has data catalog enabled, this operation could leave the catalog in an invalid state. Continue?
🤖 Using fallback value in non-interactive context: yes
Uploaded 100% (2 out of 2)"
`);
});
Expand All @@ -87,6 +89,8 @@ describe("r2", () => {
Resource location: remote

Starting bulk upload of 2 objects to bucket bulk-bucket with InfrequentAccess storage class using a concurrency of 20
? Bulk upload may overwrite existing objects. If this bucket has data catalog enabled, this operation could leave the catalog in an invalid state. Continue?
🤖 Using fallback value in non-interactive context: yes
Uploaded 100% (2 out of 2)"
`);
});
Expand Down Expand Up @@ -237,6 +241,8 @@ describe("r2", () => {
Resource location: remote

Starting bulk upload of 2 objects to bucket bulk-bucket using a concurrency of 20
? Bulk upload may overwrite existing objects. If this bucket has data catalog enabled, this operation could leave the catalog in an invalid state. Continue?
🤖 Using fallback value in non-interactive context: yes
Uploaded 100% (2 out of 2)"
`);
});
Expand Down
Loading
Loading