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

go.dev: support package owner-initiated redirect from godoc.org to pkg.go.dev #37099

Closed
myitcv opened this issue Feb 7, 2020 · 7 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite

Comments

@myitcv
Copy link
Member

myitcv commented Feb 7, 2020

What is the URL of the page with the issue?

https://godoc.org/github.com/govim/govim

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-02-07 at 06 55 04

What did you do?

Ended up on https://godoc.org/github.com/govim/govim (through a Google search)

What did you expect to see?

What would I like to have seen? To have been automatically redirected to https://pkg.go.dev/github.com/govim/govim?tab=doc

What did you see instead?

The notice shown in the screenshot above, telling me about pkg.go.dev

This issue is really a suggestion that we add a mechanism to redirect traffic from godoc.org to pkg.go.dev at a package owner's request. For example, a special tag in the source VCS, e.g. redirect_to_pkg.go.dev, could signal to godoc.org that packages within that repository should be redirected. Taking GitHub as an example, such tags can be created/removed from the UI, making this a simple task with no commits required (which is useful if a project has gone into maintenance mode). On the godoc side, I suspect the required changes would be minimal (citation required) because godoc already has the necessary logic for refreshing from VCS.

This would allow:

  • allow a partial and package owner-driven redirect of traffic, controlled by the package owner
  • help reduce the load on godoc.org and likely exercise pkg.go.dev more
  • remove the need for users to install a client side (browser) redirect from godoc.org to pkg.go.dev (which is potentially too blunt a tool in any case, if there are problems preventing some docs from being viewed on pkg.go.dev for example)

Clearly this redirect cannot be permanent, in case the package owner subsequently discovers a problem with the docs as visible on pkg.go.dev and needs to (temporarily) revert back to godoc.org.

This is, however, just a humble suggestion. My understanding of godoc.org (implementation) is very limited.

cc @julieqiu

@myitcv myitcv added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite labels Feb 7, 2020
@gopherbot gopherbot added this to the Unreleased milestone Feb 7, 2020
@julieqiu
Copy link
Member

julieqiu commented Feb 7, 2020

Thanks for the suggestion, Paul! We've been discussing adding a redirect option, and are still working on figuring out the right UX flow for people to opt-in and opt-out.

/cc @andybons @spf13

@ghost
Copy link

ghost commented Feb 8, 2020

Should the decision on which website to use be with the reader of the documentation, not the package author?

Suggestion for making it the reader's choice: Add button to godoc.org banner that drops an "automatic redirect" cookie. Automatically redirect in presence of cookie. For godoc.org home page, show UI to undo auto redirect instead of redirecting.

Edit: The proposal in this comment is for transition phase only. I think you will get better feedback from people who opt into testing pkg.go.dev than people who are forced into it by the package author.

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/218697 mentions this issue: gddo: add option to redirect requests to pkg.go.dev

gopherbot pushed a commit to golang/gddo that referenced this issue Feb 13, 2020
Updates golang/go#37099

Change-Id: Ibaf46b9182d761d56d8dc6770259ab4bc3703d59
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/218697
Reviewed-by: Andrew Bonventre <andybons@golang.org>
@julieqiu
Copy link
Member

Thanks for the suggestion, @stephenandwood!

You can now redirect your own requests from godoc.org to pkg.go.dev, by visiting godoc.org?redirect=on.

This will set a cookie in your browser, so that any request you make to godoc.org will be redirected to pkg.go.dev.

If you want to turn this feature off, you can do so by visiting godoc.org?redirect=off.

Thanks to @jamalc for this contribution!

@julieqiu julieqiu added the UX Issues that involve UXD/UXR input label Feb 28, 2020
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/222315 mentions this issue: gddo-server: add UI to turn on/off redirect to pkg.go.dev

gopherbot pushed a commit to golang/gddo that referenced this issue Mar 10, 2020
This change adds UI for the option to set a cookie and have
candidate godoc.org links redirect to their equivalent pkg.go.dev
counterparts. If a user returns to godoc.org with the utm_source
form value equal to 'backtogodoc', it will display an option to
turn off the automatic redirect.

The intention is to have a link on pkg.go.dev that allows the
user to return to godoc.org and also turn off the automatic redirect
without having to know the special URL param values.

Updates golang/go#37099

Change-Id: I27bd03cbc484a1e504795ff669224c2a2a7d72b6
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/222315
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/224659 mentions this issue: gddo-server: add utm_source to pkg.go.dev redirect URLs

gopherbot pushed a commit to golang/gddo that referenced this issue Mar 24, 2020
This will reliably indicate to pkg.go.dev that a request is due
to the automatic redirect logic.

Additional logic is added for more accurate mapping of
godoc.org -> pkg.go.dev URLs.

Updates golang/go#37099

Change-Id: Iba380a3b5951d50576c17711990d0ba87857b926
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/224659
Reviewed-by: Julie Qiu <julie@golang.org>
@julieqiu julieqiu removed the UX Issues that involve UXD/UXR input label May 1, 2020
@julieqiu
Copy link
Member

Users can now opt-in to using pkg.go.dev by clicking "Always use pkg.go.dev" on the top of any godoc.org page. We are not planning to support redirecting traffic from godoc.org to pkg.go.dev at the package owner's request.

Closing this issue.

@golang golang locked and limited conversation to collaborators Jul 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
Projects
None yet
Development

No branches or pull requests

3 participants