Skip to content

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

@changkun

Description

@changkun

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestIssues asking for a new feature that does not need a proposal.NeedsInvestigationSomeone 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