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: redirect to code files if possible #48172

Open
changkun opened this issue Sep 3, 2021 · 0 comments
Open

x/pkgsite: redirect to code files if possible #48172

changkun opened this issue Sep 3, 2021 · 0 comments

Comments

@changkun
Copy link
Contributor

@changkun changkun commented Sep 3, 2021

What is the URL of the page with the issue?

golang.org/pkg/runtime/proc.go
golang.org/x/build/dashboard/builders.go
...

What is your user agent?

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

Screenshot

Screenshot 2021-09-03 at 10 37 27

Screenshot 2021-09-03 at 10 36 03

What did you do?

Access the page

What did you expect to see?

golang.org was capable of redirect to a specific source code if the path indicates the source, and the file indeed exists.

Such as the above two pages should redirect to:

cs.opensource.google/go/go/+/master:src/runtime/proc.go
cs.opensource.google/go/x/build/+/master:dashboard/builders.go

pkgsite should also be compatible with this redirect.

To further generalize the need, as pkgsite already knows files that are contained in a package and the original repository URL, if the request router matches a contained file, then redirects to the corresponding source code, instead of showing 404 or request a new package.

What did you see instead?

404 or request a new package

@gopherbot gopherbot added this to the Unreleased milestone Sep 3, 2021
@jamalc jamalc removed this from the Unreleased milestone Sep 3, 2021
@jamalc jamalc added this to the pkgsite/golang.org-features milestone Sep 3, 2021
@jamalc jamalc removed this from the pkgsite/golang.org-features milestone Sep 3, 2021
@jamalc jamalc added this to the pkgsite/unplanned milestone Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants