Skip to content

Extract the ClickPipes clap contract and parsing tests - #401

Merged
sdairs merged 1 commit into
issue-387-services-cli-domainfrom
issue-386-clickpipes-clap
Aug 13, 2026
Merged

Extract the ClickPipes clap contract and parsing tests#401
sdairs merged 1 commit into
issue-387-services-cli-domainfrom
issue-386-clickpipes-clap

Conversation

@sdairs

@sdairs sdairs commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Closes #386

Summary

  • Move all ClickPipes command enums, argument structs, possible values, and parsing coverage into the ClickPipes domain module.
  • Preserve the boxed top-level command shape and all existing cloud::cli::* re-exports.
  • Pin commands, flags, defaults, repeatability, constraints, accepted values, and top-level write classification through the real CLI parser.
  • Leave ClickPipes runtime handlers, builders, output, and client wrappers unchanged for the following stack layer.

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:57
@sdairs
sdairs had a problem deploying to cloud-integration August 7, 2026 21:57 — with GitHub Actions Failure
@sdairs sdairs changed the title Extract ClickPipes clap contract Extract the ClickPipes clap contract and parsing tests Aug 7, 2026
@sdairs
sdairs temporarily deployed to cloud-integration August 7, 2026 22:18 — 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 ClickPipes CLI surface by relocating the entire ClickPipes clap contract (subcommands, argument structs, accepted-value sets, and parsing/write-classification tests) into a dedicated cloud::clickpipes domain module, while preserving the existing crate::cloud::cli::* public paths via re-exports.

Changes:

  • Added a new crates/clickhousectl/src/cloud/clickpipes.rs module containing all ClickPipes clap enums/args, possible-value constants, and adjacent parsing + write-classification tests.
  • Updated cloud::cli to re-export the moved ClickPipes types and to delegate CloudCommands::is_write_command() ClickPipe classification to ClickPipeCommands::is_write().
  • Wired the new module into cloud/mod.rs so the domain module is compiled and available for the existing re-export surface.

Reviewed changes

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

File Description
crates/clickhousectl/src/cloud/mod.rs Registers the new clickpipes module in the cloud domain.
crates/clickhousectl/src/cloud/clickpipes.rs New ClickPipes clap contract + exhaustive parsing/write-classification tests colocated with the definitions.
crates/clickhousectl/src/cloud/cli.rs Re-exports ClickPipes types from the new module and simplifies write-classification by delegating to ClickPipeCommands::is_write().

💡 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-386-clickpipes-clap branch from 2d1383a to 7bf0690 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 temporarily deployed to cloud-integration August 8, 2026 18:45 — with GitHub Actions Inactive
@sdairs
sdairs force-pushed the issue-386-clickpipes-clap branch from 7bf0690 to 21971fa 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:45 — with GitHub Actions Failure
@sdairs
sdairs force-pushed the issue-386-clickpipes-clap branch from 21971fa to dca826a 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 the ClickPipes clap contract and parsing tests

3 participants