Skip to content

Extract organization, member, and invitation CLI domains - #399

Merged
sdairs merged 2 commits into
issue-384-small-cloud-domainsfrom
issue-382-organization-cli-domain
Aug 13, 2026
Merged

Extract organization, member, and invitation CLI domains#399
sdairs merged 2 commits into
issue-384-small-cloud-domainsfrom
issue-382-organization-cli-domain

Conversation

@sdairs

@sdairs sdairs commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Closes #382

Summary

  • Extract organization, member, and invitation clap contracts, dispatch, handlers, builders, output, client wrappers, and tests into one organization-access module.
  • Preserve legacy positional organization IDs and pin all moved write classifications through the real top-level CLI parser.
  • Keep organization lookup wrappers available to shared resolution and service deletion.
  • Remove the moved code from generic cloud CLI, client, commands, and dispatch modules without behavior changes.

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 21:03
@sdairs
sdairs temporarily deployed to cloud-integration August 7, 2026 21:03 — with GitHub Actions Inactive
@sdairs sdairs changed the title Extract organization access CLI domain Extract organization, member, and invitation CLI domains Aug 7, 2026
@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 ClickHouse Cloud CLI by extracting the organization, member, and invitation command surface (clap contracts), dispatch, handlers, CloudClient wrappers, output helpers, and associated tests into a dedicated cloud::organizations module, aiming to preserve existing behavior while improving domain isolation.

Changes:

  • Added crates/clickhousectl/src/cloud/organizations.rs to host org/member/invitation clap enums, dispatch runners, handlers/builders, and domain-local impl CloudClient.
  • Updated cloud runtime dispatch (cloud/mod.rs) to route org/member/invitation commands through the new module.
  • Removed the extracted org/member/invitation logic from generic cloud modules (cloud/commands.rs, cloud/client.rs, cloud/cli.rs) and relocated relevant tests.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/clickhousectl/src/cloud/organizations.rs New domain module containing org/member/invitation CLI contracts, handlers, CloudClient wrappers, and tests.
crates/clickhousectl/src/cloud/mod.rs Dispatch now delegates org/member/invitation execution to cloud::organizations.
crates/clickhousectl/src/cloud/commands.rs Removed org/member/invitation handlers/builders and related tests after extraction.
crates/clickhousectl/src/cloud/client.rs Removed org/member/invitation CloudClient wrapper methods moved into cloud::organizations.
crates/clickhousectl/src/cloud/cli.rs Re-exported org/member/invitation clap enums from cloud::organizations and delegated write classification to the extracted enums.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread crates/clickhousectl/src/cloud/organizations.rs
Comment thread crates/clickhousectl/src/cloud/organizations.rs
@sdairs
sdairs force-pushed the issue-382-organization-cli-domain branch from b75a3d7 to 59522a4 Compare August 8, 2026 18:37
@sdairs
sdairs had a problem deploying to cloud-integration August 8, 2026 18:37 — 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-382-organization-cli-domain branch from 59522a4 to 7795be6 Compare August 13, 2026 11:37
@sdairs
sdairs had a problem deploying to cloud-integration August 13, 2026 11:37 — with GitHub Actions Failure
@sdairs
sdairs force-pushed the issue-382-organization-cli-domain branch from 7795be6 to ca24d6f 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 organization, member, and invitation CLI domains

3 participants