Skip to content

fix(admin): send a create request for empty groups - #424

Merged
cxymds merged 1 commit into
mainfrom
cxymds/fix-empty-group-420
Nov 18, 2026
Merged

cxymds merged 1 commit into
mainfrom
cxymds/fix-empty-group-420

Conversation

@cxymds

@cxymds cxymds commented Nov 18, 2026

Copy link
Copy Markdown
Member

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 later group info or group enable could 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 --check
  • cargo clippy --workspace -- -D warnings
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test -p rustfs-cli --test admin_group
  • cargo test --workspace
  • cargo test --package rustfs-cli --test golden --features golden

Copilot AI balanced review requested due to automatic review settings November 18, 2026 03:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@cxymds
cxymds merged commit c1a30f3 into main Nov 18, 2026
14 checks passed
@cxymds
cxymds deleted the cxymds/fix-empty-group-420 branch November 18, 2026 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create group command successful, but not created?

2 participants