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 adds focused unit coverage for the request-option mapping behind the recent
rm --purgework.The merged change in #82 introduced
delete_request_optionsso the CLI can opt into RustFS force-delete semantics, but the unit tests only exercised the positivepurge = truebranch. That left the default branch and the easy-to-confuseforce = true, purge = falsebranch unverified.Root cause
Recent follow-up PRs already covered
--purgehelp and parser wiring, plus the S3 client header behavior. The small helper incrates/cli/src/commands/rm.rsstill had a gap around the non-purge paths that feed those lower-level calls.Fix
The test module now adds two narrow assertions:
force_deletedisabled;--forcealone does not enableforce_deleteunless--purgeis also set.This keeps the scope limited to the recent
rmchange surface and avoids production code changes.Validation
I ran these successfully:
cargo test -p rustfs-cli delete_request_options --libcargo fmt --all --checkcargo clippy --workspace -- -D warningscargo test --workspaceI also ran
make pre-commitper the automation instructions, but this checkout does not define that target, somakeexits withNo rule to make target 'pre-commit'.