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: support viewing a module at a specific git commit #48100

mvdan opened this issue Aug 31, 2021 · 0 comments

x/pkgsite: support viewing a module at a specific git commit #48100

mvdan opened this issue Aug 31, 2021 · 0 comments
FeatureRequest NeedsInvestigation pkgsite


Copy link

@mvdan mvdan commented Aug 31, 2021

As far as I can tell, pkgsite supports viewing a package at three versions via

  • The default, @latest
  • @master, which works on git as the "latest development" branch of many git repos
  • Specific Go module versions, like @v1.2.3 or

go list -m some-module@some-version supports all three, plus any version known to the VCS repository. For example:

$ go list -m # short git commit
$ go list -m # git branch

I'm running with the default GOPROXY and an empty GOPRIVATE, and it seems like these simply go via

The feature request for arbitrary branches is already at #46914. This issue is about the other scenario: specific commits from the VCS. The main difference with branches is that, by definition, branches are a moving target. Specific commits are more like tags: they should generally be treated as immutable once published.

My particular use case today is similar to arbitrary branches; imagine I've pushed a new feature to a feature branch in the upstream git repo, and I want to check that pkgsite renders it well and the docs make sense. I might also want to share the link as part of a PR to allow easier review.

Right now I can do it manually via this monstrosity of a hack:

$ firefox "$(go list -m -f {{.Version}}"

Essentially, using go list -m to turn a git commit into the Go pseudo-version, then using that as the version suffix in the pkgsite URL.

It would be much better UX if pkgsite did this for me, just like go list -m does, and especially seeing how the proxy server already has the support.

@gopherbot gopherbot added this to the Unreleased milestone Aug 31, 2021
@jamalc jamalc removed this from the Unreleased milestone Sep 1, 2021
@jamalc jamalc added this to the pkgsite/unplanned milestone Sep 1, 2021
@jamalc jamalc added the NeedsInvestigation label Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
FeatureRequest NeedsInvestigation pkgsite
None yet

No branches or pull requests

4 participants