-
Notifications
You must be signed in to change notification settings - Fork 879
k8s.io: Redirect common Go package URLs to pkg.go.dev #3130
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
Conversation
|
Welcome @imjasonh! |
Hi @imjasonh. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
6225cb8
to
ff2e2ae
Compare
Signed-off-by: Jason Hall <jasonhall@redhat.com>
ff2e2ae
to
8cdf1e6
Compare
/ok-to-test @imjasonh Thanks for opening this! I could see this being helpful. However I'd want to chat with the sig-docs team that is responsible for the website first if they have any concerns. @kubernetes/sig-docs-en-owners Hello! This change is to potentially move redirect some URLs that correspond to git packages to the pkg.go.dev.. these URLs would currently go to the website, but as there is unlikely to be content that directly matches the go package URL. Do you have any thoughts? @liggitt @thockin @nikhita Also wanted to ping the three of you on this.. with the way we publish these packages, are the pkg.go.dev docs the right place to potentially redirect to? I know I've seen some funkiness before with these docs if you have irregular go module tagging practice. |
no concerns from my side - https://pkg.go.dev/k8s.io/client-go was the weirdest one and that got cleaned up by kubernetes/kubernetes#98267 and golang/go#43265 |
No problem! Definitely makes sense to check with anybody and everybody who might see where this can unexpected go wrong.
I actually found that https://k8s.io/kubernetes redirects to https://kubernetes.io/docs/home/ today, so we should probably not change this in case something depends on it. Ideally I'd like to put in redirects for all the packages in https://github.com/kubernetes/kubernetes/tree/master/staging/src/k8s.io since these tend to be Go packages with useful godoc. But I'd also be interested in feedback about how to make this sort of change easier to test before merging and rolling it out. The |
If we make this change, are we setting a convention that could set us up for a future collision with the website and its short URLs? |
apps/k8s-io/configmap-nginx.yaml
Outdated
@@ -54,6 +54,11 @@ data: | |||
'; | |||
} | |||
|
|||
# Redirect go import paths to Go package documentation. | |||
if ($repo ~ "api|apimachinery|client-go|kubernetes") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd implement this kind of redirect by editing https://github.com/kubernetes/website/blob/main/static/_redirects
Would that work? It's more visible and less likely to conflict with SIG Docs changes / plans.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh, nice. I didn't know that was also an option, this definitely seems like an easier place to put these, with preview deploys and tests and everything. I'll look into it, and possibly close this PR. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think this might be the better overall path as then we are saying: "unless we know for sure they are trying to do a go get
, then it should go to the website, and then sig-docs can do things there". Especially if this is a manual list.
Good question. As an example, This seems to me like more signal that we should maintain a hand-edited list instead of trying too hard to automate it. If we do automate it, we should have a list of exceptions for things like |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: imjasonh The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Closing this in favor of kubernetes/website#30692 Thanks for you feedback everyone! 🙏 |
Today, a valid Go import path like
k8s.io/api/core/v1
redirects to https://kubernetes.io/api/core/v1 when viewed in a browser, which is an unhelpful 404. 😢With this change, I'd like to propose that that import path should redirect to the much more helpful Go package documentation at https://pkg.go.dev/k8s.io/api/core/v1
This change currently only applies to:
k8s.io/api/...
k8s.io/apimachinery/...
k8s.io/client-go/...
k8s.io/kubernetes/...
If this is helpful we can look into applying this across more repos. The Go import redirects triggered by the presence of
?go-get=1
should be unaffected.