Skip to content

feat(cli): add --dry-run to write operations#757

Merged
joshrotenberg merged 1 commit intomainfrom
feat/dry-run-write-ops
Mar 1, 2026
Merged

feat(cli): add --dry-run to write operations#757
joshrotenberg merged 1 commit intomainfrom
feat/dry-run-write-ops

Conversation

@joshrotenberg
Copy link
Collaborator

Summary

  • Add --dry-run flag to 8 priority write commands per --dry-run support for write operations (input validation and operation preview) #752
  • Server-side dry-run for cloud create/update operations (inserts "dryRun": true into API request body)
  • Client-side dry-run for delete and enterprise operations (prints preview to stderr, exits early without mutating)
  • All dry-run output goes to stderr so it doesn't interfere with --output json piping

Commands updated

Command Mechanism
cloud subscription update Server-side
cloud subscription delete Client-side
cloud database create Server-side (forces legacy path)
cloud database update Server-side (forces legacy path)
cloud database delete Client-side
enterprise database update Client-side (shows request JSON)
enterprise database delete Client-side
enterprise cluster bootstrap Client-side (shows config JSON)

Test plan

  • cargo fmt --all -- --check
  • cargo clippy -p redisctl --all-targets --all-features -- -D warnings
  • cargo test -p redisctl --lib --all-features (72 passed)
  • cargo test -p redisctl --bin redisctl --all-features (105 passed)

Closes #752

Add --dry-run flag to 8 priority write commands using two mechanisms:

Server-side dry-run (inserts "dryRun": true into API request body):
- cloud subscription update
- cloud database create (forces legacy path)
- cloud database update (forces legacy path)

Client-side dry-run (prints preview to stderr, exits early):
- cloud subscription delete
- cloud database delete
- enterprise database update (shows planned request JSON)
- enterprise database delete
- enterprise cluster bootstrap (shows bootstrap config JSON)

Closes #752
@joshrotenberg joshrotenberg merged commit 9cfd9d6 into main Mar 1, 2026
16 checks passed
@joshrotenberg joshrotenberg deleted the feat/dry-run-write-ops branch March 1, 2026 16:59
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.

--dry-run support for write operations (input validation and operation preview)

1 participant