Skip to content

x/pkgsite: support viewing a package @master #36811

Closed

Description

@myitcv

What is the URL of the page with the issue?

https://pkg.go.dev/github.com/moby/moby/client?tab=doc

What is your user agent?

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.66 Safari/537.36

Screenshot

Screen Shot 2020-01-27 at 19 52 45

What did you do?

Visited the aforementioned link.

What did you expect to see?

The current docs for github.com/moby/moby/client, like on godoc:

https://godoc.org/github.com/docker/docker/client

(notice https://github.com/docker/docker redirects to https://github.com/moby/moby)

What did you see instead?

Per the screenshot, at the time of writing, docs for v1.13.1, which was tagged on Feb 8, 2017.

The godoc version is looking at ~master at any given moment in time.

The current advice from the project maintainers is to use master of this package/module:

Hence only godoc.org works as a means of viewing "current" docs for github.com/moby/moby/client.

Activity

  1. added
    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
    on Jan 27, 2020
  2. changed the title [-]go.dev: github.com/moby/moby/client docs are not current[/-] [+]go.dev: support viewing <import-path>@master[/+] on Jan 28, 2020
  3. changed the title [-]go.dev: support viewing <import-path>@master[/-] [+]go.dev: support viewing a package @master[/+] on Jan 28, 2020
  4. julieqiu commented on Jan 28, 2020

    @julieqiu
    Member

    We're actively working on designing a better flow, but the workaround for this right now is to do the following:

    1. Get the semantic version from proxy.golang.org using the .info endpoint. For example:
      https://proxy.golang.org/github.com/moby/moby/@v/master.info currently shows:
    {
        "Version": "v1.4.2-0.20200128034134-2ebaeef943cc",
        "Time": "2020-01-28T03:41:34Z"
    }
    

    Note. This will also automatically fetch the module for the proxy and populate it on pkg.go.dev, if it does not already exist (per instructions at https://go.dev/about#adding-a-package). It may take a minute or two for the package to appear on pkg.go.dev, if it is not already there.

    1. Visit pkg.go.dev/<import-path>@<semantic-version> for the package documentation, in this case:
      https://pkg.go.dev/github.com/moby/moby/client@v1.4.2-0.20200128034134-2ebaeef943cc.

    We know that this isn't the best user experience, and are working on a better workflow.

  5. added
    FeatureRequestIssues asking for a new feature that does not need a proposal.
    on Jan 29, 2020
  6. added this to the Unreleased milestone on Feb 6, 2020
  7. mewmew commented on Feb 24, 2020

    @mewmew
    Contributor

    We know that this isn't the best user experience, and are working on a better workflow.

    How about a "Fetch latest version from master" link added to the bottom of pages on pkg.go.dev in similar fashion to the "Refresh now" link of godoc.org?

    screenshot_2020-02-24_23:32:24

    This is issue #37106

  8. 53 remaining items

  9. julieqiu commented on Jul 30, 2020

    @julieqiu
    Member

    You can now view a package at master using the URL, https://pkg.go.dev/<path>@master. For example, https://pkg.go.dev/github.com/moby/moby/client@master.

  10. SamWhited commented on Jul 30, 2020

    @SamWhited
    Contributor

    Are there limits to this? With the exception of the example you posted, none of the common packages I use appear to work. They all use vanity URLs, so maybe this has something to do with it?

  11. julieqiu commented on Jul 30, 2020

    @julieqiu
    Member

    @SamWhited - mind sharing what they are? I can look into it.

  12. SamWhited commented on Jul 30, 2020

    @SamWhited
    Contributor

    @julieqiu here are two of mine that appear to be exhibiting this behavior: https://pkg.go.dev/code.soquee.net/otp@master or https://pkg.go.dev/mellium.im/xmpp@master

  13. SamWhited commented on Jul 30, 2020

    @SamWhited
    Contributor

    Oh, apparently I have to "request" them or it 404s? I hadn't visited the actual page to click the link. I don't know what that means, but it's confusing

  14. julieqiu commented on Jul 30, 2020

    @julieqiu
    Member

    The reason is because code.soquee.net/otp@master and mellium.im/xmpp@master weren't in our database yet. In the future, visiting these pages will automatically refresh master.

    Feel free to file a new issue with any UI suggestions.

  15. hugelgupf commented on Sep 10, 2020

    @hugelgupf
    Contributor

    Hi @julieqiu,

    a lot of repositories are now moving to renaming their default branches to main. It seems that master is hard-coded in pkgsite. Would it be possible to support some kind of magic version string that gets the default branch, whatever it may be named? This may end up being the reason that I move some of my repos back to master, which I'd like to avoid.

    Let me know if I should open another issue for this.

    Thanks!

  16. myitcv commented on Sep 10, 2020

    @myitcv
    MemberAuthor

    @hugelgupf - this issue is closed. Please open a new issue.

    FWIW the means by which git can determine the default remote (origin in this case) branch looks like this:

    git remote set-head origin -a
    

    which then updates the following:

    $ cat .git/refs/remotes/origin/HEAD
    ref: refs/remotes/origin/main
    
  17. anacrolix commented on Nov 11, 2020

    @anacrolix
    Contributor

    In my experience, this only seems fixed for vanity URLs. More general module names don't work, like https://pkg.go.dev/github.com/anacrolix/torrent@master.

  18. anacrolix commented on Oct 7, 2021

    @anacrolix
    Contributor

    This is broken for https://pkg.go.dev/github.com/anacrolix/torrent@master, is it related to this?

  19. added a commit that references this issue on Oct 7, 2021
  20. locked and limited conversation to collaborators on Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestIssues asking for a new feature that does not need a proposal.FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.pkgsite

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址