Skip to content

Fix clickpipe scale usage error for missing scale flags - #628

Open
sdairs wants to merge 1 commit into
fix/604-postgres-switchover-promotefrom
fix/605-clickpipe-scale-usage-error
Open

Fix clickpipe scale usage error for missing scale flags#628
sdairs wants to merge 1 commit into
fix/604-postgres-switchover-promotefrom
fix/605-clickpipe-scale-usage-error

Conversation

@sdairs

@sdairs sdairs commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • cloud clickpipe scale <svc> <pipe> with none of --replicas/--cpu-millicores/--memory-gb sent an empty PATCH body, which the API 400s on and the CLI surfaced generically as Error: Internal error (exit 1).
  • Added a required, multiple(true) clap ArgGroup over the three flags on the Scale command variant so the empty case is now rejected as a client-side usage error (exit 2) before any request is sent, naming the valid flags in the usage message.

Stacked PR: based on fix/604-postgres-switchover-promote, not main.

Test plan

  • Clap parse tests next to the Scale command definition: zero flags rejected, each single flag accepted, and a multi-flag combination accepted (crates/clickhousectl/src/cloud/clickpipes.rs).
  • Updated the existing read/write classification test and the previous "no flags" parse test, which both relied on the old permissive behavior.
  • Added subprocess wiremock tests in crates/clickhousectl/tests/cli_request_shape_test.rs: no-flag invocation exits 2 without hitting the mock API; single-flag invocation sends the expected PATCH body.
  • cargo fmt --all, cargo clippy --workspace --all-targets -- -D warnings, cargo test -p clickhousectl all pass.
  • Updated README.md clickpipe scale example to note the flag requirement.

Fixes #605

🤖 Generated with Claude Code

@sdairs
sdairs force-pushed the fix/605-clickpipe-scale-usage-error branch from 0723446 to b8fc6cb Compare August 28, 2026 14:46
`clickpipe scale` with none of --replicas/--cpu-millicores/--memory-gb
sent an empty PATCH body, which the API 400s on and the CLI surfaced
as a generic "Internal error" (exit 1). Add a required, multi-arg
ArgGroup over the three flags so clap rejects the empty case as a
usage error (exit 2) before any request is sent.

Fixes #605

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sdairs
sdairs force-pushed the fix/605-clickpipe-scale-usage-error branch from b8fc6cb to d248ce8 Compare August 28, 2026 19:41
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.

clickpipe scale with no flags returns Internal error instead of usage error

1 participant