test(s3): cover batch delete force-delete header omission#84
Draft
test(s3): cover batch delete force-delete header omission#84
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 force-delete change added RustFS-specific header handling for both single-object and batch-object deletes. The batch path already had a positive test for
force_delete = true, but it did not verify the default path where the header must be omitted. That left room for a regression where ordinary batch deletes could start sending the RustFS purge header unintentionally.This change adds a focused unit test in
crates/s3/src/client.rsthat exercisesdelete_objects_with_optionswithDeleteRequestOptions::default()and asserts thatx-rustfs-force-deleteis absent from the outgoing request. The scope stays limited to the recently changed codepath and does not alter production behavior.Root Cause
The recent test coverage around force-delete support validated the enabled branch for batch deletes and both enabled and disabled branches for single-object deletes. The disabled branch for batch deletes was left uncovered.
Validation
The repository does not currently define a
make pre-committarget, so I ran the CI-equivalent checks directly:cargo fmt --all --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspaceI also ran the focused regression check:
cargo test -p rc-s3 delete_objects_ -- --nocapture