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

Closed
rsc opened this issue Apr 20, 2020 · 11 comments
Closed

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

rsc opened this issue Apr 20, 2020 · 11 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite UX Issues that involve UXD/UXR input

Comments

@rsc
Copy link
Contributor

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 The path to resolution is known, but the work has not been done. label Apr 20, 2020
@gopherbot gopherbot added this to the Unreleased milestone Apr 20, 2020
@julieqiu
Copy link
Member

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

@julieqiu julieqiu added UX Issues that involve UXD/UXR input NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed NeedsFix The path to resolution is known, but the work has not been done. labels Apr 20, 2020
@spf13
Copy link
Contributor

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 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
Member

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 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 commented Apr 22, 2020

@Joanne881107, any ideas? :)

@bcmills
Copy link
Contributor

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) {

@jinhongy
Copy link

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

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>
@gopherbot
Copy link

Change https://golang.org/cl/254578 mentions this issue: internal/frontend: update logic for truncated version strings

gopherbot pushed a commit to golang/pkgsite that referenced this issue Sep 14, 2020
The logic for formatVersion is updated.

For pseudo versions, the version string will use a short commit hash
of 7 characters to identify the version, and hide timestamp using
ellipses:

1. vX.0.0-yyyymmddhhmmss-abcdefabcdef
    formatVersion("v0.0.0-20200710095922-abcdefabcdef") =>
      "v0.0.0-...-abcdefa"

2. vX.Y.Z-pre.0.yyyymmddhhmmss-abcdefabcdef
    formatVersion("v1.5.2-pre.0.20200331155302-abcdefabcdef") =>
      "v1.5.2-pre.0...-abcdefa"

3. vX.Y.(Z+1)-0.yyyymmddhhmmss-abcdefabcdef
    formatVersion("v1.5.2-0.20200201180026-77c1076d39f7") =>
      "v1.5.2-0...-abcdefa"

For any version string longer than 25 characters, the pre-release string
will be truncated, such that the string displayed is exactly 25
characters, including the ellipses:

  formatVersion("v1.0.0-longprereleasestring") =>
    "v1.0.0-longprereleasestri..."

  formatVersion("v1.0.0-pre-release.0.20200420093620-87861123c523") =>
    "v1.0.0-pre-rel...-abcdefa"

For golang/go#38542

Change-Id: I07441bc17799f5e445f36834556aa15dc87506e3
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/254578
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
@julieqiu
Copy link
Member

The suggestions from #38542 (comment) have been implemented. Logic for the truncated version string is described in https://go-review.googlesource.com/c/pkgsite/+/254578.

See #42280 as a follow up for usability improvements for truncated version strings.

@golang golang locked and limited conversation to collaborators Oct 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite UX Issues that involve UXD/UXR input
Projects
None yet
Development

No branches or pull requests

6 participants