feat: pin the Kosli CLI to a major or minor version#24
Merged
Conversation
The version input now accepts a partial version in addition to an exact semver and latest: "2" resolves to the newest stable 2.x release and "2.11" to the newest stable 2.11.z. A partial pin lists kosli-dev/cli releases, ignores drafts and pre-releases, and picks the highest match numerically, so it never crosses into the next major. latest and exact pins are unchanged; exact pins stay API-free. Refs kosli-dev/server#5996 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
kosli version --short prints a v-prefixed string (v2.11.27); the stricter equality/prefix check must normalise it. The resolver and download path are unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…or-pin test
- action.yml: document the "2" / "2.11" partial-pin forms on the version
input, and note that a major/minor pin also consumes github-token. The
README already documented both; the action metadata had drifted.
- test: assert a major pin stays on major 2 (not just !startsWith("3.")),
and add a higher major (v10.0.0) to the fixture so the never-cross-major
property is genuinely exercised rather than coincidentally satisfied.
Addresses review nits on #24.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
Ran a detailed multi-agent review over this before merging: seven dimensions (resolution correctness, input edge cases, tests, the CI workflow, packaging/release, docs, and security), with every finding independently re-checked by a second pass to weed out false positives. Short version: the resolution logic holds up really well and it's correctly shipped as a v5 minor. No blocker or major issues, just three small consistency nits, all now fixed. Fixed in c223b65
Considered, deliberately left alone
Tests are green locally (33) and CI's re-running on the new head. Happy to merge once it's green. |
mbevc1
reviewed
Jun 23, 2026
mbevc1
approved these changes
Jun 23, 2026
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.
What
setup-cli-actioncould only install an exact CLI version orlatest. This adds a third option: pin the CLI to a major (or minor) line and pick up every update within it, without ever rolling onto the next breaking major.version: "2"resolves to the newest stable2.xreleaseversion: "2.11"resolves to the newest stable2.11.zreleaseHow
src/download.js: a partial spec listskosli-dev/clireleases, drops drafts and pre-releases, and picks the highest match numerically (so2.27.3beats2.9.0), never crossing into a higher major.latestand exact pins are unchanged. Exact pins stay API-free; a partial pin uses the GitHub API likelatestalready does, through the existing retry wrapper.@v5consumer picks it up automatically.Heads up for users
Quote partial versions in YAML:
version: 2.10unquoted is parsed as the float2.1. Documented in the README.Tests
avacases cover major and major.minor resolution, pre-release/draft exclusion, numeric ordering, and the no-match error. Full suite green (33 tests)."2"and"2.11"end to end; the pinned-version check fails if an install ever crosses a major.Tracking: kosli-dev/server#5996