Extract auth, activity, backup, and API-key CLI domains - #398
Merged
sdairs merged 1 commit intoAug 13, 2026
Merged
Conversation
sdairs
temporarily deployed
to
cloud-integration
August 7, 2026 20:48 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the clickhousectl cloud CLI by extracting the auth, activity, backups (including backup-config), and API-key domains into dedicated vertical-slice modules, while keeping the public CLI surface and behavior stable via re-exports through cloud::cli.
Changes:
- Move auth clap definitions + dispatch/handlers into
cloud::auth, and routecloud auth ...throughauth::run. - Extract activity, backups/backup-config, and API-key command stacks (clap types, dispatch, handlers, request builders, CloudClient wrappers, and tests) into
cloud::activity,cloud::backups, andcloud::api_keys. - Remove the corresponding handlers/wrappers from
cloud::commands/cloud::client, and update call sites to use the extracted modules (including shared API-key cleanup/provisioning helpers).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/clickhousectl/src/cloud/service_query.rs | Switches provisioning cleanup to use the shared api_keys::discard_api_key helper. |
| crates/clickhousectl/src/cloud/mod.rs | Adds new domain modules and delegates auth/activity/backup/key dispatch into them. |
| crates/clickhousectl/src/cloud/commands.rs | Removes extracted handlers/builders and imports shared API-key cleanup helpers for service deletion. |
| crates/clickhousectl/src/cloud/client.rs | Removes activity/backup/backup-config/api-key wrapper methods now owned by the extracted modules. |
| crates/clickhousectl/src/cloud/cli.rs | Re-exports extracted clap enums and delegates write-classification to per-domain is_write() methods. |
| crates/clickhousectl/src/cloud/backups.rs | New backups + backup-config domain slice (clap, handlers, request builder, CloudClient wrappers, tests). |
| crates/clickhousectl/src/cloud/auth.rs | Co-locates auth clap definitions and handlers; adds tests for parsing and write classification. |
| crates/clickhousectl/src/cloud/api_keys.rs | New API-key domain slice including builders, cleanup helpers, CloudClient wrappers, and tests. |
| crates/clickhousectl/src/cloud/activity.rs | New activity domain slice (clap, handlers, CloudClient wrappers, tests). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
sdairs
force-pushed
the
issue-384-small-cloud-domains
branch
from
August 8, 2026 18:37
d9836b3 to
483fa3d
Compare
sdairs
had a problem deploying
to
cloud-integration
August 8, 2026 18:38 — with
GitHub Actions
Failure
sdairs
had a problem deploying
to
cloud-integration
August 8, 2026 18:45 — with
GitHub Actions
Failure
sdairs
force-pushed
the
issue-384-small-cloud-domains
branch
from
August 13, 2026 11:37
483fa3d to
8311c5b
Compare
sdairs
had a problem deploying
to
cloud-integration
August 13, 2026 11:38 — with
GitHub Actions
Failure
sdairs
had a problem deploying
to
cloud-integration
August 13, 2026 11:52 — with
GitHub Actions
Failure
sdairs
force-pushed
the
issue-384-small-cloud-domains
branch
from
August 13, 2026 18:29
8311c5b to
c144dfb
Compare
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.
Closes #384
Summary
Tests
cargo fmt --allcargo check --workspace --all-featurescargo test -p clickhousectlcargo clippy -p clickhousectl --all-targets -- -D warnings