Skip to content

feat(ENG-15913): accept a major version for --version - #17

Draft
cloudsmith-iduffy wants to merge 3 commits into
mainfrom
eng-15913
Draft

cloudsmith-iduffy wants to merge 3 commits into
mainfrom
eng-15913

Conversation

@cloudsmith-iduffy

@cloudsmith-iduffy cloudsmith-iduffy commented Nov 18, 2026 •

Copy link
Copy Markdown

Summary

A pipeline can now stay on one major version of the CLI. Today --version latest installs the highest release, so when CLI 2.0.0 ships, every pipeline that uses latest moves to 2.x.

Install the highest 1.x release after 2.0.0 ships

Run install.sh --version 1, or install.ps1 -Version 1 in PowerShell.

  1. The installer reads cloudsmith-cli-v1-manifest-<target>/versions/latest/manifest.txt. Cloudsmith resolves versions/latest by semantic version, so this manifest names the highest 1.x release.
  2. The installer checks that the manifest names a 1.x release. If the manifest names a release outside 1.x, the install fails.

Install latest or an exact version

--version latest and --version 1.40.3 work as before. The default stays latest.

Download the script and its checksums

The README now tells you to download the script and SHA256SUMS from the same versioned path. The latest path 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 and SHA256SUMS can 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 1 gets a 404 for the manifest.

ENG-15913.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactoring
  • Other (please describe)

Validation

  • bats: bats tests/ passes 51 tests, and 3 are new.
    • Two tests check the install and the major-version check.
    • One test puts a curl stub on PATH. It checks that --version 1 requests cloudsmith-cli-v1-manifest-<target>/versions/latest/manifest.txt, with no network.
  • Pester: install.ps1 builds the default manifest URL in the new Get-DefaultManifestUrl function.
    • Two Pester tests call the function through the script AST, as the request metadata tests do, so they run on every host.
    • On macOS with PowerShell 7.7, 9 tests pass and the 29 Windows-only tests are skipped. CI runs the two new Windows install tests.
  • Linters: shellcheck --shell=sh --severity=style install.sh, sh -n install.sh, and Invoke-ScriptAnalyzer -Settings PSGallery pass.

Compatibility

No existing use changes. Before this change, --version 1 always failed, because the installer asked for versions/1/manifest.txt, which doesn't exist. The four-line output contract, the options, the environment variables, and the paths don't change.

Checklist

  • I have added or updated tests where appropriate.
  • I have updated documentation and CHANGELOG.md where appropriate.
  • I have not included credentials, tokens, or other sensitive data.
  • I have called out any breaking change explicitly.

🤖 Generated with Claude Code

--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>
Copilot AI balanced review requested due to automatic review settings November 18, 2026 12:19

Copilot AI 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.

🟡 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

Comment thread install.ps1 Resolved
Comment thread install.sh Resolved
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>

Copilot AI 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.

🟢 Approval recommended

There are no active review issues for the installer major-version pinning change.

2 open issues

Review effort: Balanced

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>

Copilot AI 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.

🔵 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

Copilot AI 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.

🟢 Approval recommended

No active review issues remain for the CLI installer major-version pinning change.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants