Skip to content

Expose project scope in local server errors - #517

Closed
sdairs wants to merge 4 commits into
issue-472-atomic-server-metadatafrom
issue-477-server-project-scope-errors
Closed

Expose project scope in local server errors#517
sdairs wants to merge 4 commits 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

Comment thread crates/clickhousectl/src/error.rs

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4948a14. Configure here.

Comment thread crates/clickhousectl/src/error.rs
@sdairs
sdairs force-pushed the issue-477-server-project-scope-errors branch from d3c7ff9 to e1dbf66 Compare August 25, 2026 12:11
@sdairs
sdairs force-pushed the issue-472-atomic-server-metadata branch from 5fbaee3 to c2c2303 Compare August 25, 2026 12:11
@sdairs

sdairs commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator Author

what about if we check for the presence of a .clickhouse dir in the CWD when a local command is run - and if there isn't one - we can tailor the output to give the message that we dont search for parent .clickhouse dirs must be run from project root

@sdairs

sdairs commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator Author

I think this belongs in this PR rather than a separate issue: it directly improves project-scoped server errors. We should keep it narrow to commands that require existing project state, such as server stop and server remove. When .clickhouse is absent from the current directory, the error should explain that clickhousectl does not search parent directories and that .clickhouse typically lives in the local project root where the server was started. It should not apply to commands such as server start that can initialize project state. We can agree the exact command/error scope before implementing it.

@iskakaushik iskakaushik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@sdairs

sdairs commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #559 in stack #563.

@sdairs sdairs closed this Aug 27, 2026
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.

Expose project scope in local server stop/remove/remove errors

2 participants