Report invalid local versions directly - #345
Open
sdairs wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes error plumbing in the local version-spec parsing path so that invalid version syntax is reported directly (as an “invalid version …” message) instead of being misclassified as a version lookup miss, which previously caused a double-wrapped/garbled error message for inputs like not.a.version.
Changes:
- Introduce a dedicated
Error::InvalidVersionvariant and updateparse_version_specto use it for syntax/shape failures. - Tighten unit tests around invalid spec shapes to assert on the precise error variant and message.
- Add an integration (subprocess) regression test ensuring
local use not.a.versionis not wrapped with “No matching version found for: …”.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/clickhousectl/tests/local_version_error_test.rs | Adds a subprocess regression test validating user-facing stderr and ensuring no lookup-wrapper is applied for invalid specs. |
| crates/clickhousectl/src/version_manager/spec.rs | Switches parse failures from NoMatchingVersion to InvalidVersion and strengthens unit assertions for invalid inputs. |
| crates/clickhousectl/src/error.rs | Adds Error::InvalidVersion(String) for unwrapped parser/validation diagnostics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sdairs
force-pushed
the
codex/issue-340-local-use-error
branch
from
August 3, 2026 18:42
ed30721 to
1ae545f
Compare
sdairs
marked this pull request as ready for review
August 3, 2026 18:42
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
No matching version found for:local useWhy
parse_version_specusedError::NoMatchingVersionfor both parser failures and genuine resolution misses. That error variant adds a lookup-specific prefix, so an input such asnot.a.versionproduced a double-wrapped, garbled message.Impact
clickhousectl local use not.a.versionnow reports:Genuine lookup misses continue to use the existing
No matching version found for:message.Stack
This PR is stacked on #343 and should be reviewed as the delta from
codex/issue-323-openapi-drift.Closes #340.
Validation
cargo fmt --all --checkcargo build -p clickhousectl --all-targetscargo test -p clickhousectlcargo clippy -p clickhousectl --all-targets -- -D warnings