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 a focused unit test for the default
rm --purgebehavior.The recent force-delete support already had coverage for the enabled path and integration coverage for permanent deletion behavior, but the opposite branch was still untested: when
--purgeis not supplied, the CLI should keepforce_deletedisabled in the delete request options. This PR adds that missing assertion without changing production code.Root Cause
PR #82 introduced the
purgeflag and added a unit test for thetruecase only. That left the defaultfalsebranch unguarded, even though the flag wiring is security-sensitive because it controls whether RustFS permanent deletion headers are sent.Fix
Add
test_delete_request_options_disable_force_delete_by_defaultincrates/cli/src/commands/rm.rsand assert thatdelete_request_optionskeepsforce_deleteset tofalsewhenpurgeis not provided.Validation
make pre-commitis not defined in this checkout, so I ran the repository's required checks directly:cargo fmt --all --checkcargo clippy --workspace -- -D warningscargo test --workspacecargo test -p rustfs-cli test_delete_request_options_disable_force_delete_by_defaultNotes
I also checked for an existing open PR on this topic and avoided duplicating the parser coverage already proposed in PR #98.