Skip to content

Parse positional server names on start - #366

Open
sdairs wants to merge 2 commits into
issue-353-docker-pull-progressfrom
issue-357-server-start-name
Open

Parse positional server names on start#366
sdairs wants to merge 2 commits into
issue-353-docker-pull-progressfrom
issue-357-server-start-name

Conversation

@sdairs

@sdairs sdairs commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Closes #357

Summary

  • accept the ClickHouse server name positionally for local server start, matching stop and remove
  • retain documented --name compatibility with a clear conflict when both forms are supplied
  • require -- before clickhouse-server passthrough arguments so later clickhousectl flags remain parseable
  • document the command contract and add clap plus subprocess regression coverage

Tests

  • cargo fmt --all
  • cargo test -p clickhousectl local::cli::tests
  • cargo test -p clickhousectl --test local_server_start_args_test
  • cargo test -p clickhousectl
  • cargo clippy -p clickhousectl --all-targets -- -D warnings

@sdairs
sdairs requested review from iskakaushik and rndD as code owners August 5, 2026 12:30
@sdairs sdairs changed the title Fix server start name parsing (#357) Parse positional server names on start Aug 5, 2026
@sdairs
sdairs force-pushed the issue-357-server-start-name branch from 30a82f8 to b8a5185 Compare August 5, 2026 13:42
Comment thread crates/clickhousectl/src/local/cli.rs

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 fixes clickhousectl local server start argument parsing to align with server stop/remove and prevent clickhousectl flags (e.g. --version) from being silently forwarded as ClickHouse server args. It introduces a positional server name for start, preserves --name for compatibility with an explicit conflict, and requires -- to begin clickhouse-server passthrough arguments.

Changes:

  • Accept optional positional server name for local server start, while keeping --name as a compatible alternative (mutually exclusive).
  • Change clickhouse-server passthrough parsing so arguments must be provided after -- (keeping clickhousectl flags parseable).
  • Add clap parsing regression tests and a subprocess-level regression test covering the original issue scenario.

Reviewed changes

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

File Description
README.md Updates documentation/examples for positional server name and -- passthrough boundary.
crates/clickhousectl/src/local/cli.rs Adjusts clap definitions for server start (positional name, --name compatibility, -- passthrough) and adds parsing tests.
crates/clickhousectl/src/local/mod.rs Wires the two naming forms together (name.or(name_flag)) before calling start_server.
crates/clickhousectl/tests/local_server_start_args_test.rs Adds subprocess regression coverage ensuring positional name doesn’t swallow --version and passthrough args remain isolated.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sdairs
sdairs force-pushed the issue-357-server-start-name branch from d088144 to 0dbf795 Compare August 5, 2026 18:28
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.

server start silently ignores options after a positional server name

2 participants