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 change adds focused parser coverage for the deprecated top-level
rc cors setentrypoint introduced with the recent bucket CORS management work. The current suite already coveredrc bucket cors set ...and a few top-levelrc corsflows, but it did not exercise the top-levelsetpath itself.The missing coverage mattered because the deprecated top-level command is still wired through Clap separately from
rc bucket cors. A regression there would break users invokingrc cors setwithout being caught by the existing tests, even though the nested bucket command still worked.Root cause
The original CORS feature and follow-up tests focused on bucket-path validation, help discoverability, source reading, and a subset of command aliases. The top-level
setparser branch, including its legacy--fileflag wiring and--forcepropagation, was left untested.Fix
The test suite now verifies two narrow parser paths in
crates/cli/src/commands/mod.rs:rc cors set local/my-bucket cors.xmlrc cors set local/my-bucket --file cors.json --forceThese assertions confirm the deprecated top-level command still maps to
CorsCommands::Set, preserves the bucket path, selects the expected source field, and forwards the--forceflag.Validation
I ran the following checks successfully:
cargo test -p rustfs-cli cli_accepts_top_level_corscargo fmt --all --checkcargo clippy --workspace -- -D warningscargo test --workspaceI also attempted
make pre-commitper automation instructions, but this repository currently has noMakefileorpre-committarget, somakeexits withNo rule to make target 'pre-commit'.