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: prerelease info truncated in version list #38542

Open
rsc opened this issue Apr 20, 2020 · 9 comments
Open

x/pkgsite: prerelease info truncated in version list #38542

rsc opened this issue Apr 20, 2020 · 9 comments

Comments

@rsc
Copy link
Contributor

@rsc rsc commented Apr 20, 2020

---------- Forwarded message ---------
From: volf.tomas@gmail.com
Date: Mon, Apr 20, 2020 at 1:55 PM
Subject: [golang-dev] pkg.go.dev does not display whole version
To: golang-dev golang-dev@googlegroups.com

I have a module using semantic versioning (1.0.0-pre-release+1), which
according to https://semver.org/ should be correct semver. However when
I check my package at pkg.go.dev:

https://pkg.go.dev/mod/git.sr.ht/~graywolf/gomemcache?tab=versions

I see

v1 – git.sr.ht/~graywolf/gomemcache
   v1.0.0 (8786112) – 0 hours ago
   v1.0.0 (58609c4) – 1 hour ago

without listing the whole version string. I think that is kinda confusing. Sincehttps://go.dev/about mentions this mailing list to send suggestiongs to, I thinkit would be nice to list whole version string.
Have a nice day,W.

@rsc rsc added the NeedsFix label Apr 20, 2020
@gopherbot gopherbot added this to the Unreleased milestone Apr 20, 2020
@gopherbot gopherbot added the pkgsite label Apr 20, 2020
@julieqiu
Copy link
Contributor

@julieqiu julieqiu commented Apr 20, 2020

Thanks for the feedback! The reason this was truncated was to make the version string more readable for pseudoversions, since they can be pretty long. I agree that this is less precise, and we might want to consider displaying the version string as is.

/cc @spf13 @fflewddur @Joanne881107 for product/UX input

@spf13
Copy link
Contributor

@spf13 spf13 commented Apr 20, 2020

Agree this needs fixing. I think there is a solution that handles the case of pseudoversions explicitly by shortening that pattern to something reasonable, and then allows for any other versions like this to be displayed.

@ghost
Copy link

@ghost ghost commented Apr 20, 2020

FWIW: "1.0.0-pre-release+1" is 19 characters, "1.0.0 (8786112)" is 15 characters. So the difference in visible space is ~4-8 characters AFAICT.

@julieqiu
Copy link
Contributor

@julieqiu julieqiu commented Apr 21, 2020

In this case, the full version string would be v1.0.0-pre-release.0.20200420093620-87861123c523. See https://proxy.golang.org/git.sr.ht/~graywolf/gomemcache/@latest.

@spf13
Copy link
Contributor

@spf13 spf13 commented Apr 22, 2020

I see, I misunderstood, this example is itself a pseudoversion, not a released version. It's less clear what to do here. Maybe just truncate the pseudoversion portion of the version string? Not sure if that makes sense or would be hard to do reliably.

@spf13
Copy link
Contributor

@spf13 spf13 commented Apr 22, 2020

@Joanne881107, any ideas? :)

@bcmills
Copy link
Member

@bcmills bcmills commented Apr 22, 2020

You might consider stripping off the “base” from which the pseudo-version is derived¹ and reporting that along with the commit hash.

That said, I'm not sure what's wrong with showing the complete pseudo-version in the first place...

¹

// PseudoVersionBase returns the canonical parent version, if any, upon which
// the pseudo-version v is based.
//
// If v has no parent version (that is, if it is "vX.0.0-[…]"),
// PseudoVersionBase returns the empty string and a nil error.
func PseudoVersionBase(v string) (string, error) {

@Joanne881107
Copy link

@Joanne881107 Joanne881107 commented Apr 22, 2020

There are 2 places we would need to display the version number:

  1. Version info on the header: In this case, it's better to truncate the version string to make it more readable. My suggestion is maybe use "1.1.0-pre-release" instead? Or truncated the string as "1.1.0-pre-release...23", when hover on the string, show a tooltip display the entire string.
  2. Version info in "versions" tab: In this case, I think it's fine to display the entire string.
@julieqiu julieqiu changed the title go.dev: prerelease info truncated in version list x/pkgsite: prerelease info truncated in version list Jun 15, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Jul 13, 2020

Change https://golang.org/cl/242363 mentions this issue: internal/frontend: display full semantic version on versions tab

gopherbot pushed a commit to golang/pkgsite that referenced this issue Jul 14, 2020
Rather than displaying a truncated version on the versions tab,
display the full semantic version.

For golang/go#38542

Change-Id: I7bb6ee3e90f4ffe406cfea99996145f0d9e36f6b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/242363
Reviewed-by: Jonathan Amsterdam <jba@google.com>
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
7 participants
@rsc @spf13 @bcmills @julieqiu @Joanne881107 @gopherbot and others
You can’t perform that action at this time.