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
This change adds coverage for a small but important path introduced by the recent delete-options work in the S3 client. When
delete_objects_with_optionsis called with an empty key list, the method should return successfully without constructing or sending an HTTP request.That behavior matters because the rm purge and batch-delete flow now routes through the new delete-options helper, and empty batches are a legitimate no-op case during prefix cleanup or chunked deletion logic. Without an explicit regression test, a future refactor could accidentally remove the early return and start issuing malformed or unnecessary delete requests.
Root Cause
The implementation already had the correct guard clause for an empty
keysvector, but the path was not covered by unit tests. Recent work added option-aware delete wrappers and header mutation logic, increasing the chance that request-building code could be touched again without preserving the no-op behavior.Fix
Add a focused unit test in
crates/s3/src/client.rsthat:delete_objects_with_optionswith an empty key listValidation
I could not run
make pre-commitbecause this repository does not define that target. I ran the CI-equivalent checks used by the repo instead:cargo test -p rc-s3 delete_objects_with_empty_keys_skips_requestcargo fmt --all --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspace