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 PR adds focused unit coverage for the legacy
ObjectStoredelete wrappers in the S3 client. The recent force-delete work introduced options-aware delete helpers and tests around*_with_options, but the wrapper methods that existing call sites still use did not have direct coverage proving they delegate through the default option path.Problem
Without a wrapper-level assertion, a future refactor could accidentally bypass the default options path and start sending the RustFS force-delete header for normal deletes. That would silently change ordinary delete behavior from delete-marker creation to permanent deletion on versioned buckets.
Root Cause
The original test additions validated explicit option handling, including force-delete header emission and omission on the
*_with_optionsmethods. TheObjectStoretrait implementation methodsdelete_objectanddelete_objectsnow delegate into those helpers, but there was no regression test pinning that delegation.Fix
The change adds two S3 client unit tests that call the wrapper methods directly and capture the generated HTTP requests. Each test asserts that the
x-rustfs-force-deleteheader is absent when the wrapper uses default request options.Validation
I first ran the two new unit tests directly:
cargo test -p rc-s3 delete_object_wrapper_uses_default_options_without_rustfs_headercargo test -p rc-s3 delete_objects_wrapper_uses_default_options_without_rustfs_headerI then ran the repo's CI-equivalent checks:
cargo fmt --all --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspacemake pre-commitwas also requested by the automation prompt, but this checkout does not contain a Makefile or apre-committarget, so I used the commands defined in.github/workflows/ci.ymlinstead.