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
Labels
FrozenDueToAge help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite

Comments

@catzkorn
Copy link
Contributor

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.

@gopherbot gopherbot added this to the Unreleased milestone Dec 1, 2020
@julieqiu julieqiu modified the milestones: Unreleased, pkgsite/unplanned Dec 1, 2020
@julieqiu julieqiu added help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Dec 1, 2020
@sudo-sturbia
Copy link

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

@julieqiu
Copy link
Member

Please do!

@gopherbot
Copy link

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

@golang golang locked and limited conversation to collaborators Dec 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite
Projects
None yet
Development

No branches or pull requests

4 participants