Skip to content

Add --name compatibility for local server teardown - #555

Merged
sdairs merged 2 commits into
stack/472-atomic-server-metadatafrom
stack/474-server-name-compatibility
Aug 27, 2026
Merged

Add --name compatibility for local server teardown#555
sdairs merged 2 commits into
stack/472-atomic-server-metadatafrom
stack/474-server-name-compatibility

Conversation

@sdairs

@sdairs sdairs commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • accept canonical positional names and compatibility --name for local server stop and remove
  • preserve omitted names through clap and dispatch while retaining the current default runtime fallback
  • advertise only positional names in agent-context help so the compatibility flag can age out
  • cover conflicts, omission, trailing options, exact dispatch identity, and agent-help guidance

Tests

  • cargo test -p clickhousectl
  • cargo fmt --all --check
  • cargo clippy -p clickhousectl --all-targets -- -D warnings

Closes #474

@sdairs

sdairs commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator Author

Carry-over review from PR #488 (old PR for #474). The clap shape is identical to #488 and the subprocess tests here are genuinely better (decoy-server dispatch-identity assertions, no-side-effect conflict check, dedicated tests/local_server_name_compatibility_test.rs). But this PR directly violates the one substantive sdairs review comment on #488. Required:

  1. Stop advertising --name in the agent-context help. On Add --name compatibility to local server stop and remove #488, sdairs wrote: "remove the added mention of --name in the agent context help. the flag exists as compat but should not be advertised to aide in aging it out." Add --name compatibility to local server stop and remove #488 fixed this in commit fc70ebf ("Stop advertising teardown name flag"); its final help only says "pass it positionally to select another server (e.g., server stop dev)". In this PR, both agent-context blocks advertise the compat form:

    • crates/clickhousectl/src/local/cli.rs:~421-422 (stop): "The compatibility form --name dev remains accepted, but cannot be combined with a positional name."
    • crates/clickhousectl/src/local/cli.rs:~467-468 (remove): same sentence.
      Delete both sentences (port the intent of fc70ebf). The /// Compatibility form for the server name; prefer positional NAME flag doc lines are milder (Add --name compatibility to local server stop and remove #488's final state kept similar), but combined with the above the compat form is heavily advertised — reconsider those too.
  2. Consider whether the stop_server()/remove_server() extraction in mod.rs (~70 lines of churn) is needed — Add --name compatibility to local server stop and remove #488 proved two-line inline resolution suffices. Defensible tidiness, but borderline for a compat-flag PR.

  3. CI note: local postgres edge cases fails here but identically across the stack base — inherited from Validate local Postgres start options #547's script drift, not this PR's change.

@sdairs
sdairs force-pushed the stack/474-server-name-compatibility branch from 4f6c1f1 to 2a1c118 Compare August 26, 2026 18:58
@sdairs
sdairs force-pushed the stack/474-server-name-compatibility branch from 2a1c118 to 6b4836d Compare August 26, 2026 19:01
@sdairs
sdairs force-pushed the stack/474-server-name-compatibility branch 2 times, most recently from 9a3a07b to c4a2e26 Compare August 26, 2026 19:07
@sdairs
sdairs force-pushed the stack/474-server-name-compatibility branch 2 times, most recently from 31bbb5f to d12fcab Compare August 26, 2026 19:12
@sdairs
sdairs force-pushed the stack/474-server-name-compatibility branch from d12fcab to d2805d4 Compare August 26, 2026 19:20
@sdairs
sdairs force-pushed the stack/474-server-name-compatibility branch 3 times, most recently from f538d5a to f8b37ca Compare August 26, 2026 19:31
@sdairs
sdairs force-pushed the stack/474-server-name-compatibility branch from f8b37ca to 17da846 Compare August 26, 2026 19:34
@sdairs
sdairs force-pushed the stack/474-server-name-compatibility branch 2 times, most recently from 79abe7f to db8927e Compare August 26, 2026 20:10
@sdairs
sdairs force-pushed the stack/474-server-name-compatibility branch 2 times, most recently from 3b3f0e5 to e890593 Compare August 26, 2026 20:35
@sdairs
sdairs force-pushed the stack/474-server-name-compatibility branch 2 times, most recently from 51f17a6 to 8d730cd Compare August 26, 2026 20:41
@sdairs
sdairs force-pushed the stack/474-server-name-compatibility branch from 8d730cd to 12976d4 Compare August 26, 2026 20:44
@sdairs
sdairs force-pushed the stack/474-server-name-compatibility branch 2 times, most recently from 05859c2 to afa4325 Compare August 26, 2026 20:55
@sdairs
sdairs force-pushed the stack/474-server-name-compatibility branch from afa4325 to 5eafa8b Compare August 27, 2026 06:34
@sdairs
sdairs force-pushed the stack/474-server-name-compatibility branch from 5eafa8b to 1646e06 Compare August 27, 2026 06:44
@sdairs
sdairs force-pushed the stack/474-server-name-compatibility branch 2 times, most recently from 2aa5a36 to e358b1c Compare August 27, 2026 06:53
@sdairs
sdairs force-pushed the stack/474-server-name-compatibility branch from e358b1c to 676755c Compare August 27, 2026 06:57
@sdairs
sdairs force-pushed the stack/474-server-name-compatibility branch from 676755c to 61a6675 Compare August 27, 2026 07:06
@sdairs
sdairs force-pushed the stack/474-server-name-compatibility branch from 0ae81ad to a5750dc Compare August 27, 2026 09:19
@sdairs
sdairs force-pushed the stack/474-server-name-compatibility branch from a5750dc to 7463d59 Compare August 27, 2026 10:13
@sdairs
sdairs force-pushed the stack/474-server-name-compatibility branch from 7463d59 to 23f23b9 Compare August 27, 2026 10:51
@sdairs
sdairs merged commit 4211ece into main Aug 27, 2026
14 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.

Add --name compatibility form to local server stop and remove

2 participants