Skip to content

Expose project scope in local server errors - #517

Open
sdairs wants to merge 1 commit into
issue-472-atomic-server-metadatafrom
issue-477-server-project-scope-errors
Open

Expose project scope in local server errors#517
sdairs wants to merge 1 commit into
issue-472-atomic-server-metadatafrom
issue-477-server-project-scope-errors

Conversation

@sdairs

@sdairs sdairs commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • report the canonical exact project directory for project-scoped server list, stop, and remove lookup, metadata, and state failures
  • state that parent .clickhouse directories are not searched and provide fixed recovery commands for running and stopped servers
  • preserve bounded structured error codes while adding an optional project field; keep project paths in command output only and out of telemetry
  • retain exact-CWD behavior through child directories, nested .clickhouse state, and symlinked working directories without adding a new --project flag

Closes #477

Tests

  • isolated subprocess coverage for root versus child scope, nested state, running and stopped servers, symlinked CWDs, metadata/list failures, and JSON/human output
  • cargo fmt --all --check
  • cargo build -p clickhousectl
  • cargo check -p clickhousectl --no-default-features
  • cargo test -p clickhousectl (633 unit tests plus all integration suites)
  • cargo clippy -p clickhousectl --all-targets -- -D warnings

Stack

}

pub fn with_project_server_scope(self, project: String) -> Self {
if !matches!(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium src/error.rs:220

server list returns the unscoped Error::Io when reading the project .clickhouse/servers directory fails, so the error omits the canonical lookup directory, recovery guidance, and structured project field. with_project_server_scope excludes Error::Io from its wrapping match; include this variant so permission and other directory-read failures receive the same project-scoped context.

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @crates/clickhousectl/src/error.rs around line 220:

`server list` returns the unscoped `Error::Io` when reading the project `.clickhouse/servers` directory fails, so the error omits the canonical lookup directory, recovery guidance, and structured `project` field. `with_project_server_scope` excludes `Error::Io` from its wrapping match; include this variant so permission and other directory-read failures receive the same project-scoped context.

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.

1 participant