Suggest --force when deleting a running service - #351
Open
sdairs wants to merge 1 commit into
Open
Conversation
sdairs
had a problem deploying
to
cloud-integration
August 1, 2026 10:30 — with
GitHub Actions
Failure
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the ClickHouse Cloud service delete UX by translating a specific “service is running” API conflict into an actionable CLI error that points users to the two supported recovery paths (--force or stopping the service explicitly), while keeping other deletion conflicts unchanged.
Changes:
- Added targeted error rewriting for running-service deletion conflicts when
--forceis not set. - Updated the
service deletehandler to apply the new error mapping on API failures. - Added unit + subprocess regression tests that assert the exact stderr output for the conflict case.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
crates/clickhousectl/src/cloud/commands.rs |
Adds service_delete_error and wires it into service_delete, plus unit tests covering the mapping behavior. |
crates/clickhousectl/tests/cli_request_shape_test.rs |
Adds a wiremock-backed subprocess test asserting the improved error message for a 409 running-service delete conflict. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sdairs
had a problem deploying
to
cloud-integration
August 3, 2026 12:20 — with
GitHub Actions
Failure
sdairs
force-pushed
the
codex/issue-335-delete-force-hint
branch
from
August 3, 2026 18:42
f1aeb7c to
9389472
Compare
sdairs
had a problem deploying
to
cloud-integration
August 3, 2026 18:42 — with
GitHub Actions
Failure
sdairs
temporarily deployed
to
cloud-integration
August 3, 2026 18:50 — with
GitHub Actions
Inactive
sdairs
force-pushed
the
codex/issue-335-delete-force-hint
branch
from
August 3, 2026 19:34
9389472 to
195110e
Compare
sdairs
temporarily deployed
to
cloud-integration
August 3, 2026 19:34 — with
GitHub Actions
Inactive
sdairs
marked this pull request as ready for review
August 3, 2026 19:38
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.
Summary
--forcehintclickhousectl cloud service stop <id>alternative in the error--forcewhen it was already passedWhy
cloud service deletecurrently passes through the Cloud API'sCONFLICTresponse when the service is running, even though the CLI already supports the recovery path through--force. Users have to discover that remedy separately.Impact
Deleting a running service without
--forcenow returns a concise error that explains both supported next steps. Other deletion failures retain their original API errors.Stack
This PR is stacked on #349 and should be reviewed as the delta from
codex/issue-339-idempotent-install.Closes #335.
Validation
cargo fmt --all --checkcargo build -p clickhousectlcargo test -p clickhousectlcargo clippy -p clickhousectl --all-targets -- -D warnings