local init --json: report all created paths - #617
Open
sdairs wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ 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 416867f. Configure here.
sdairs
force-pushed
the
fix/609-local-init-json-paths
branch
from
August 28, 2026 19:41
83d45b0 to
d30c70e
Compare
`local init --json` only reported `{"path": ".clickhouse/"}`, omitting the
`clickhouse/` and `postgres/` scaffold subtrees that human output already
reports. `init()` now returns which paths it actually created, and
`InitOutput` reports the full set as `paths: Vec<String>`, listing
`.clickhouse/` plus `clickhouse/`/`postgres/` only when their scaffolds were
newly created (matching the conditional human-readable messages).
Added subprocess coverage (crates/clickhousectl/tests/local_init_json_test.rs)
for the first-run and idempotent-run JSON payloads, plus updated inline unit
tests in src/init.rs and src/local/output.rs.
Fixes #609.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The install-integration classifier fails closed on unclassified test files; local_init_json_test.rs only scaffolds directories in a temp project and never installs a binary, so it maps to the non-install set (mirrored in the classifier test's literal copy). Human-mode `local init` printed every created path twice: init() eprinted detailed absolute-path lines while print_output repeated them on stdout via InitOutput's Display. init() is now silent and InitOutput is the single source of human output, including the "Already initialized" wording for idempotent runs, carried by a serde-skipped field so the --json payload introduced for #609 is unchanged. Subprocess tests pin first-run and second-run human output. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
sdairs
force-pushed
the
fix/609-local-init-json-paths
branch
from
September 1, 2026 20:36
d30c70e to
b81e59c
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.

Summary
local init --jsonpreviously reported only{"path": ".clickhouse/"}, omitting theclickhouse/andpostgres/scaffold subtrees that the human-readable output already reports (e.g.Created project scaffold in clickhouse/ (tables, materialized_views, queries, seed)).init()now returns anInitResultindicating which of.clickhouse/,clickhouse/, andpostgres/were actually created during the invocation.InitOutputnow exposespaths: Vec<String>(replacing the singlepath: Stringfield) listing.clickhouse/always, plusclickhouse/and/orpostgres/only when their scaffold was newly created this run — matching the conditional human-readable messages exactly.Displayoutput forInitOutputalso grew a line per newly-created scaffold, solocal init(non-JSON) now reports scaffold creation via the same output type, not just viaeprintln!insideinit().This PR is part of a stacked chain based on
fix/607-prometheus-json-help(notmain).Test plan
cargo fmt --all --checkcargo clippy -p clickhousectl --all-targets -- -D warningscargo test -p clickhousectl(all passing, including newtests/local_init_json_test.rssubprocess coverage for first-run vs. idempotent-run JSON payloads, and updated inline unit tests insrc/init.rs/src/local/output.rs)Fixes #609
🤖 Generated with Claude Code