Repository navigation
feat(ENG-15913): accept a major version for --version - #17
Draft
cloudsmith-iduffy wants to merge 3 commits into
Draft
cloudsmith-iduffy wants to merge 3 commits into
cloudsmith-iduffy wants to merge 3 commits into
Conversation
--version 1 (-Version 1 in PowerShell) installs the latest 1.x release from the cloudsmith-cli-v1-manifest-<target> manifest. The installer fails when the manifest is outside the requested major version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Both shell and PowerShell tests override the manifest URL, leaving major-channel URL generation untested and incorrect package names or version paths undetected.
2 open issues
What changed in this PR
Adds major-version pinning to the shell and PowerShell installers so pipelines can receive updates within one CLI major version without upgrading to the next.
Changes:
- Resolves numeric versions through major-specific manifests and rejects releases outside the requested major.
- Adds tests for matching and mismatched manifest versions in both installers.
- Documents major-version selection and downloading scripts and checksums from the same versioned path.
| File | Description |
|---|---|
| tests/Install.Tests.ps1 | Adds PowerShell major-version acceptance and rejection tests. |
| tests/install.bats | Adds shell major-version acceptance and rejection tests. |
| README.md | Explains major-version pinning and consistent verified downloads. |
| install.sh | Adds major-channel URL selection, validation, and help text. |
| install.ps1 | Adds major-channel URL selection and validation. |
| CHANGELOG.md | Records support for major-version selection. |
Review effort: Balanced
The bats test records the URL that curl gets. The Pester tests call the new Get-DefaultManifestUrl function, which now builds the default manifest URL in install.ps1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Windows PowerShell wraps the error text of a native command, so the full message can break across lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🔵 Needs a closer look
Major-version installation depends on open draft CLI PR cloudsmith-io/cloudsmith-cli#627, so a human must confirm the required manifests are published before the installer change is released.
2 open issues
Review effort: Balanced
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
A pipeline can now stay on one major version of the CLI. Today
--version latestinstalls the highest release, so when CLI 2.0.0 ships, every pipeline that useslatestmoves to 2.x.Install the highest 1.x release after 2.0.0 ships
Run
install.sh --version 1, orinstall.ps1 -Version 1in PowerShell.cloudsmith-cli-v1-manifest-<target>/versions/latest/manifest.txt. Cloudsmith resolvesversions/latestby semantic version, so this manifest names the highest 1.x release.Install
latestor an exact version--version latestand--version 1.40.3work as before. The default stayslatest.Download the script and its checksums
The README now tells you to download the script and
SHA256SUMSfrom the same versioned path. Thelatestpath resolves each file separately. Just after a release, a CDN copy of one file can be up to 10 minutes older than the other. The script andSHA256SUMScan then come from different releases.Release order
cloudsmith-io/cloudsmith-cli#627 is merged. The first CLI release that includes it publishes the
cloudsmith-cli-v1-manifest-<target>manifests. Release this change after that CLI release. Before it,--version 1gets a 404 for the manifest.ENG-15913.
Type of change
Validation
bats tests/passes 51 tests, and 3 are new.curlstub onPATH. It checks that--version 1requestscloudsmith-cli-v1-manifest-<target>/versions/latest/manifest.txt, with no network.install.ps1builds the default manifest URL in the newGet-DefaultManifestUrlfunction.shellcheck --shell=sh --severity=style install.sh,sh -n install.sh, andInvoke-ScriptAnalyzer -Settings PSGallerypass.Compatibility
No existing use changes. Before this change,
--version 1always failed, because the installer asked forversions/1/manifest.txt, which doesn't exist. The four-line output contract, the options, the environment variables, and the paths don't change.Checklist
CHANGELOG.mdwhere appropriate.🤖 Generated with Claude Code