Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/pkgsite: prefer prerelease over pseudo when defining @latest #41379

Closed
julieqiu opened this issue Sep 14, 2020 · 2 comments
Closed

x/pkgsite: prefer prerelease over pseudo when defining @latest #41379

julieqiu opened this issue Sep 14, 2020 · 2 comments

Comments

@julieqiu
Copy link
Contributor

@julieqiu julieqiu commented Sep 14, 2020

go help goproxy says:

When resolving the latest version of a module, the go command will request
/@v/list, then, if no suitable versions are found, <module>/@latest.
The go command prefers, in order: the semantically highest release version,
the semantically highest pre-release version, and the chronologically
most recent pseudo-version. In Go 1.12 and earlier, the go command considered
pseudo-versions in /@v/list to be pre-release versions, but this is
no longer true since Go 1.13.

We currently implement the older meaning of latest (highest release, then highest anything else).
We should change that to prefer pre-release versions to pseudo-versions.

Example: pkg.go.dev/github.com/Netflix/titus-api-definitions shows
the pseudo-version v0.0.1-rc9.0.20200212222136-a4a89636720b

Screen Shot 2020-09-14 at 11 32 59 AM

but go get github.com/Netflix/titus-api-definitions@latest fetches
v0.0.01-rc9 and https://proxy.golang.org/github.com/!netflix/titus-api-definitions/@latest:

{"Version":"v0.0.1-rc9","Time":"2017-10-31T18:43:32Z"}
@gopherbot gopherbot added this to the Unreleased milestone Sep 14, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Sep 14, 2020

Change https://golang.org/cl/254577 mentions this issue: internal/postgres: prefer prerelease over pseudo as latest version

gopherbot pushed a commit to golang/pkgsite that referenced this issue Sep 14, 2020
The definition of @latest is changed to prefer pre-release versions
over pseudo-versions.

This matches the definition of @latest for the go command as of go1.13.

For golang/go#41379

Change-Id: Ia5e4cc42822245636d216467aee1e088a40569c5
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/254577
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Julie Qiu <julie@golang.org>
@julieqiu
Copy link
Contributor Author

@julieqiu julieqiu commented Sep 15, 2020

Fixed.

@julieqiu julieqiu closed this Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants