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: GetLatestMajorVersion in proxydatasource does not support incompatible modules #42922

Closed
catzkorn opened this issue Dec 1, 2020 · 3 comments

Comments

@catzkorn
Copy link

@catzkorn catzkorn commented Dec 1, 2020

What version of Go are you using (go version)?

go1.15.5

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/charlotte/Library/Caches/go-build"
GOENV="/Users/charlotte/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/charlotte/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/charlotte/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.15.5/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.15.5/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/charlotte/src/pkgsite/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

I started the frontend locally with the direct proxy flag set.

$ go run ./cmd/frontend -direct_proxy

Navigated to http://localhost:8080/github.com/golang-migrate/migrate/v3@v3.5.2

What did you expect to see?

I expected to see a warning that there was a greater version available as it does on the pkg.go.dev.
Screenshot 2020-12-01 at 12 10 49

What did you see instead?

I saw no banner.
Screenshot 2020-12-01 at 12 10 07

Discussion

I found this issue while working on and testing #42292. The problem appears to be that GetLatestMajorVersion in the proxydatasource assumes that the first suffixed module uses a v2 suffix. In the case of golang migrate, the first suffixed module appears to be /v3 given that both v1 and v2 are on a non suffixed module.

I would assume we could fix this by parsing the version returned from the first GetInfo call and using that as a basis for subsequent suffixed module names.

@sudo-sturbia
Copy link

@sudo-sturbia sudo-sturbia commented Dec 11, 2020

@julieqiu I would like to claim this, if it's no problem.

@julieqiu
Copy link
Contributor

@julieqiu julieqiu commented Dec 11, 2020

Please do!

@gopherbot
Copy link

@gopherbot gopherbot commented Dec 12, 2020

Change https://golang.org/cl/277472 mentions this issue: internal/proxydatasource: support incompatible modules in GetLatestMajorVersion

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
4 participants