x/pkgsite: GetLatestMajorVersion in proxydatasource does not support incompatible modules #42922
Labels
FrozenDueToAge
help wanted
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
pkgsite
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I started the frontend locally with the direct proxy flag set.
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.

What did you see instead?
I saw no banner.

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.
The text was updated successfully, but these errors were encountered: