Skip to content

test(s3): cover batch delete force-delete header omission#84

Draft
overtrue wants to merge 1 commit intomainfrom
codex/test-batch-force-delete-header-gap
Draft

test(s3): cover batch delete force-delete header omission#84
overtrue wants to merge 1 commit intomainfrom
codex/test-batch-force-delete-header-gap

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

@overtrue overtrue commented Apr 4, 2026

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.rs that exercises delete_objects_with_options with DeleteRequestOptions::default() and asserts that x-rustfs-force-delete is 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-commit target, so I ran the CI-equivalent checks directly:

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace

I also ran the focused regression check:

  • cargo test -p rc-s3 delete_objects_ -- --nocapture

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant