Repository navigation
fix(admin): send a create request for empty groups - #424
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the group-creation change.
No open issues 🎉
What changed in this PR
Fixes #420 by making empty-group creation contact the server before reporting success, using the same admin request as creation with initial members.
Changes:
- Sends
"members": []when no members are supplied and reports server rejections through the existing error path. - Adds local HTTP regression tests for empty and populated groups, request payloads, JSON success output, and rejection handling.
| File | Description |
|---|---|
crates/cli/tests/admin_group.rs |
Adds request and output regression tests for group creation. |
crates/cli/src/commands/admin/group.rs |
Always sends the group request before emitting success, preserving existing output formats. |
Review effort: Balanced
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.
Fixes #420.
In rc 0.1.37, running
rc admin group add <alias> <group>without initial members returned exit code 0 and printed a success message without contacting RustFS. A latergroup infoorgroup enablecould therefore fail because the group did not exist.Group creation now sends the same admin request for empty and populated groups. When no members are supplied, the request contains
"members": []. The CLI reports success after the server accepts the request and propagates a rejection through the existing error path.Regression coverage
The tests run the CLI against a local HTTP server. They check the PUT path, membership payload, and JSON success output for both empty and populated groups. A separate 403 case verifies exit code 1 and empty stdout. Both tests failed before the fix.
Validation
cargo fmt --all --checkcargo clippy --workspace -- -D warningscargo clippy --workspace --all-targets -- -D warningscargo test -p rustfs-cli --test admin_groupcargo test --workspacecargo test --package rustfs-cli --test golden --features golden