Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

fix: tolerate leading v in semantic versions from coder version API #449

Merged
merged 2 commits into from
Sep 30, 2021

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented Sep 30, 2021

vX.Y.Z is not tolerated by semver.StrictNewVersion, but is what we embed into our build metadata.
Replace all existing uses of NewStrictVersion outside test code with its non-strict equivalent NewVersion.

$ go build -ldflags "-X cdr.dev/coder-cli/internal/version.Version=v12.34.56" ./cmd/coder
$ ./coder update
info: Current version of coder-cli is "v12.34.56"
info: Coder instance at "██████████████████████" reports version "1.21.0-rc.1+738-g20e9135d8-20210929"
? Do you want to download version 1.21.0 instead? [y/N] y█
info: query github releases
  | url: "https://api.github.com/repos/cdr/coder-cli/releases/tags/v1.21.0-rc.1"
info: fetching coder-cli from GitHub releases
  | https://github.com/cdr/coder-cli/releases/download/v1.21.0-rc.1/coder-cli-linux-amd64.tar.gz
info: updated binary reports "coder version v1.21.0-rc.1 go1.16.6 linux/amd64"
success: Updated coder CLI to version 1.21.0-rc.1+738-g20e9135d8-20210929

@johnstcn johnstcn self-assigned this Sep 30, 2021
@coveralls
Copy link

coveralls commented Sep 30, 2021

Pull Request Test Coverage Report for Build 1290564789

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 6 of 7 (85.71%) changed or added relevant lines in 1 file are covered.
  • 50 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.03%) to 48.014%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/cmd/update.go 6 7 85.71%
Files with Coverage Reduction New Missed Lines %
wsnet/dial.go 2 78.02%
internal/cmd/update.go 48 74.43%
Totals Coverage Status
Change from base Build 1280854818: 0.03%
Covered Lines: 2816
Relevant Lines: 5865

💛 - Coveralls

@johnstcn johnstcn merged commit 34d96a1 into main Sep 30, 2021
@johnstcn johnstcn deleted the cj/noissue/semver_nonstrict branch September 30, 2021 14:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants