Skip to content

Extract auth, activity, backup, and API-key CLI domains - #398

Merged
sdairs merged 1 commit into
issue-383-cloud-runtime-boundaryfrom
issue-384-small-cloud-domains
Aug 13, 2026
Merged

Extract auth, activity, backup, and API-key CLI domains#398
sdairs merged 1 commit into
issue-383-cloud-runtime-boundaryfrom
issue-384-small-cloud-domains

Conversation

@sdairs

@sdairs sdairs commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Closes #384

Summary

  • Co-locate auth clap definitions and dispatch with cloud authentication.
  • Extract activity, backup/backup-config, and API-key vertical slices, including clap, dispatch, handlers, builders, client wrappers, output, and tests.
  • Preserve service backup-config classification and shared API-key cleanup/provisioning workflows.
  • Remove the moved handlers and wrappers from generic cloud monoliths without changing commands, requests, or output.

Tests

  • cargo fmt --all
  • cargo check --workspace --all-features
  • cargo test -p clickhousectl
  • cargo clippy -p clickhousectl --all-targets -- -D warnings

@sdairs
sdairs requested review from iskakaushik and rndD as code owners August 7, 2026 20:48
@sdairs sdairs changed the title Extract auth activity backup and API key domains Extract auth, activity, backup, and API-key CLI domains Aug 7, 2026
@sdairs
sdairs temporarily deployed to cloud-integration August 7, 2026 20:48 — with GitHub Actions Inactive
@sdairs
sdairs requested a lite review from Copilot August 8, 2026 08:16

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.

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 route cloud auth ... through auth::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, and cloud::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
sdairs force-pushed the issue-384-small-cloud-domains branch from d9836b3 to 483fa3d Compare August 8, 2026 18:37
@sdairs
sdairs had a problem deploying to cloud-integration August 8, 2026 18:38 — with GitHub Actions Failure
@sdairs
sdairs had a problem deploying to cloud-integration August 8, 2026 18:45 — with GitHub Actions Failure
@sdairs
sdairs force-pushed the issue-384-small-cloud-domains branch from 483fa3d to 8311c5b Compare August 13, 2026 11:37
@sdairs
sdairs had a problem deploying to cloud-integration August 13, 2026 11:38 — with GitHub Actions Failure
@sdairs
sdairs had a problem deploying to cloud-integration August 13, 2026 11:52 — with GitHub Actions Failure
@sdairs
sdairs force-pushed the issue-384-small-cloud-domains branch from 8311c5b to c144dfb Compare August 13, 2026 18:29

@iskakaushik iskakaushik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@sdairs
sdairs merged commit faf940a into main Aug 13, 2026
4 checks passed
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.

Extract auth, activity, backup, and API-key CLI domains

3 participants