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 based on custom import paths #44520

Open
AGWA opened this issue Feb 23, 2021 · 4 comments
Open

x/pkgsite: redirect based on custom import paths #44520

AGWA opened this issue Feb 23, 2021 · 4 comments

Comments

@AGWA
Copy link

@AGWA AGWA commented Feb 23, 2021

What is the URL of the page with the issue?

https://pkg.go.dev/github.com/SSLMate/go-pkcs12

What is your user agent?

Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Screenshot

pkg go dev png

What did you do?

Navigated to https://pkg.go.dev/github.com/SSLMate/go-pkcs12

What did you expect to see?

Be redirected to the documentation for software.sslmate.com/src/go-pkcs12 as this is the canonical import path for the package: https://github.com/SSLMate/go-pkcs12/blob/master/pkcs12.go#L18

godoc.org exhibited the expected behavior.

What did you see instead?

I saw documentation for the package github.com/SSLMate/go-pkcs12, even though this is not the canonical import path.

@gopherbot gopherbot added the pkgsite label Feb 23, 2021
@gopherbot gopherbot added this to the Unreleased milestone Feb 23, 2021
@AGWA
Copy link
Author

@AGWA AGWA commented Feb 23, 2021

Another example of a package that doesn't redirect to the canonical import path: https://pkg.go.dev/github.com/golang/crypto/bcrypt

@julieqiu
Copy link
Contributor

@julieqiu julieqiu commented Feb 23, 2021

The reason is because https://pkg.go.dev/github.com/SSLMate/go-pkcs12 is showing the latest version (v0.0.0-20201103104416-57fc603b7f52) where it was still the canonical import path. If that version didn't exist on pkg.go.dev, it would redirect to pkg.go.dev/software.sslmate.com/src/go-pkcs12.

We're planning to fix this as part of #44437.

@jamalc jamalc modified the milestones: Unreleased, pkgsite/unplanned Feb 23, 2021
@jamalc jamalc added the NeedsFix label Feb 23, 2021
@julieqiu julieqiu changed the title x/pkgsite: doesn't redirect to canonical import path x/pkgsite: requests do not redirect to when alternative path exists at an earlier version when it was the canonical path Feb 23, 2021
@julieqiu julieqiu changed the title x/pkgsite: requests do not redirect to when alternative path exists at an earlier version when it was the canonical path x/pkgsite: requests do not redirect when alternative path exists at an earlier version when it was the canonical path Feb 23, 2021
@AGWA
Copy link
Author

@AGWA AGWA commented Feb 23, 2021

Thanks @julieqiu. That version did have the canonical import path set to software.sslmate.com/src/go-pkcs12. I assume the redirection is based on the module path in go.mod rather than the canonical import path? In any case I'm glad a fix is planned.

@julieqiu
Copy link
Contributor

@julieqiu julieqiu commented Feb 23, 2021

I assume the redirection is based on the module path in go.mod rather than the canonical import path?

Yup that is correct.

I think it makes sense to support custom import paths in addition to redirecting based on the go.mod path.

@julieqiu julieqiu changed the title x/pkgsite: requests do not redirect when alternative path exists at an earlier version when it was the canonical path x/pkgsite: redirect based on custom import paths Feb 23, 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