golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.82k stars 17.65k forks source link

x/pkgsite: new major version not surfaced when it does not yet have a release tag #41532

Open bcmills opened 4 years ago

bcmills commented 4 years ago

What did you do?

In the pkg.go.dev search bar, enter go.etcd.io/etcd and press the Enter key.

What did you expect to see?

“The latest major version is v3”, per #37765, due to the existence of a module go.etcd.io/etcd/v3

What did you see instead?

A “Latest” badge, with no indication of a corresponding module with a higher major version, for both the package path and the corresponding module path.

The v3 module is also not listed on https://pkg.go.dev/mod/go.etcd.io/etcd?tab=versions, although it is not obvious to me whether it should be included there.

The module go.etcd.io/etcd/v3 is present and indexed on pkg.go.dev, but it appears that no release version has yet been tagged for that module. (https://pkg.go.dev/mod/go.etcd.io/etcd/v3?tab=versions lists the latest version as a pseudo-version for commit 353fcf0, and does mention the release versions of the corresponding v0/v1 module.)

CC @julieqiu @AceroM @fflewddur


image

image

julieqiu commented 4 years ago

The issue here is that module go.etcd.io/etcd/v3 does not have any tagged versions - https://proxy.golang.org/github.com/etcd-io/etcd/v3/@v/list returns an empty list.

As a result, pkg.go.dev recognizes v0 as the "latest stable" major version.

We should update the message on page like this. See also #41345.

Closing this as a dupe of #41345.

julieqiu commented 3 years ago

Reopening this issue, since it requires a slightly different fix than #41345.

There is a bug in GetLatestMajorVersion, where the major version string will be an empty string if it is not v2 or higher.

It should show:

image