Skip to content

feat(admin): add expansion workflow command#180

Merged
overtrue merged 1 commit intomainfrom
codex/implement-scale-command
May 7, 2026
Merged

feat(admin): add expansion workflow command#180
overtrue merged 1 commit intomainfrom
codex/implement-scale-command

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

@overtrue overtrue commented May 7, 2026

Related Issue(s)

None.

Problem Background and User Impact

RustFS expansion requires operators to add server pools in the deployment configuration first, then run a post-expansion rebalance. The CLI exposed pool inspection and rebalance commands separately, but did not provide an expansion-oriented command path.

Root Cause Summary

The existing admin command set had the backend rebalance API integration, but no dedicated command that matches the expansion workflow language users expect.

Solution Overview

  • Add rc admin expand start|status|stop for post-expansion rebalancing.
  • Add scale as a convenience alias for the same command group.
  • Reuse the existing rebalance Admin API implementation instead of inventing unsupported online pool-add behavior.
  • Update help contract coverage, README examples, and the v2 output schema entries.

Test Status

  • cargo fmt --all --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace

@overtrue overtrue marked this pull request as ready for review May 7, 2026 05:59
@overtrue overtrue merged commit 7d0dbf8 into main May 7, 2026
15 checks passed
@overtrue overtrue deleted the codex/implement-scale-command branch May 7, 2026 05:59
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 78e79a2b98

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +39 to +41
/// Manage post-expansion data rebalancing
#[command(alias = "scale", subcommand)]
Expand(expand::ExpandCommands),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Document the new CLI contract in SPEC

Adding the public rc admin expand command changes the CLI contract, but docs/SPEC.md still only documents admin rebalance and has no admin expand syntax, alias, JSON-output references, or exit-code section. Since AGENTS.md identifies docs/SPEC.md as the CLI behavior contract and the PR checklist requires contract changes to be documented, users and any spec-based validation will miss this new workflow even though it is now exposed in help and README.

Useful? React with 👍 / 👎.

Copilot AI review requested due to automatic review settings May 7, 2026 06:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an expansion-oriented admin command group to guide operators through the post-pool-expansion rebalance workflow, reusing the existing rebalance Admin API integration.

Changes:

  • Introduces rc admin expand start|status|stop (with scale alias) as a wrapper around existing rebalance functionality.
  • Refactors rebalance command internals to share start/stop behavior with customizable messages.
  • Updates README examples and help contract tests; extends the v2 output schema with expand-related entries.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
schemas/output_v2.json Adds schema entries for admin expand outputs (status + operation).
README.md Documents rc admin expand usage and adds it to the admin subcommand table.
crates/cli/tests/help_contract.rs Adds help contract coverage for rc admin expand and its subcommands.
crates/cli/src/commands/admin/rebalance.rs Extracts reusable start/stop helpers and exposes status executor for reuse.
crates/cli/src/commands/admin/mod.rs Wires the new expand command (and scale alias) into the admin command tree.
crates/cli/src/commands/admin/expand.rs Implements the new expansion workflow command group by delegating to rebalance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

message: "Rebalance started successfully".to_string(),
message: success_message.to_string(),
target: args.alias,
id: Some(result.id),
Comment thread schemas/output_v2.json
Comment on lines +758 to +762
"title": "admin expand status",
"description": "Post-expansion rebalance status output",
"$ref": "#/definitions/rebalanceStatus"
},
{
Comment thread schemas/output_v2.json
Comment on lines +763 to 787
"title": "admin expand operation",
"description": "Post-expansion rebalance start/stop output",
"type": "object",
"required": [
"success",
"message",
"target"
],
"properties": {
"success": {
"type": "boolean"
},
"message": {
"type": "string"
},
"target": {
"type": "string"
},
"id": {
"type": "string",
"description": "Rebalance operation ID returned by start"
}
}
},
{
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.

2 participants