Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A recent delete-options refactor introduced an early return in
delete_objects_with_optionsfor empty batches. That branch is important because recursive delete flows can legally produce no keys after listing, and the client should return success locally instead of attempting an unnecessary S3 request.This change adds one focused unit test in
crates/s3/src/client.rsthat callsdelete_objects_with_optionswith an empty key list, asserts the returned deleted list is empty, and verifies that no HTTP request is emitted through the capture client. Production code is unchanged.Root Cause
The recent
rm --purgework added targeted coverage for header handling on delete requests, but it did not cover the new no-op branch inside the batch delete helper. That left a regression window where a future refactor could accidentally send an empty delete request even when the function is supposed to short-circuit.Validation
I attempted to run
make pre-commit, but this repository does not define that target in the current checkout (make: *** No rule to make target 'pre-commit'. Stop.). I then ran the repository's required validation commands directly:cargo test -p rc-s3 delete_objects_with_empty_keys_skips_requestcargo fmt --all --checkcargo clippy --workspace -- -D warningscargo test --workspace