-
Notifications
You must be signed in to change notification settings - Fork 18k
x/pkgsite: prerelease info truncated in version list #38542
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
Comments
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 |
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. |
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. |
In this case, the full version string would be |
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. |
@Joanne881107, any ideas? :) |
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... ¹ go/src/cmd/go/internal/modfetch/pseudo.go Lines 149 to 154 in e221a75
|
There are 2 places we would need to display the version number:
|
Change https://golang.org/cl/242363 mentions this issue: |
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>
Change https://golang.org/cl/254578 mentions this issue: |
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>
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. |
---------- 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.
The text was updated successfully, but these errors were encountered: