Fix running server remove error message - #363
Open
sdairs wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the error message shown when attempting to remove a running local ClickHouse server, making it actionable (“stop it first …”) while preserving the existing “already running” wording for server start name collisions. This aligns CLI behavior with issue #325’s expected UX without changing the underlying refusal-to-remove logic.
Changes:
- Introduce a dedicated error variant (
ServerRunningCannotRemove) with a stop-first instruction. - Update the local
server removehandler to return the new error when the target server is running. - Add an integration-style regression test covering both
remove(new message) andstart(existing collision message).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/clickhousectl/tests/local_server_stopped_test.rs | Adds a regression test asserting the new stop-first remove error and unchanged start collision error. |
| crates/clickhousectl/src/local/mod.rs | Switches server remove to return the new “running; stop first” error variant when applicable. |
| crates/clickhousectl/src/error.rs | Adds ServerRunningCannotRemove with the expected actionable error message. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sdairs
force-pushed
the
issue-325-running-remove-error
branch
from
August 5, 2026 18:28
ff90e32 to
419d198
Compare
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.
Closes #325
Summary
Tests
cargo test -p clickhousectl --test local_server_stopped_test running_server_remove_has_stop_first_error_and_start_keeps_collision_error -- --exactcargo test -p clickhousectlcargo clippy -p clickhousectl --all-targets -- -D warnings