-
Notifications
You must be signed in to change notification settings - Fork 267
Package Files links are 404 for packages in GitHub repo subdirs. #484
Comments
Edit: Actually, this is more related to #405. gddo has some support for non-master default branches, but it's specific to github.com and not all import paths. This bug is actually caused by 7f31cf3, which resolved #405. |
I've created CL https://golang.org/cl/40499 that fixes this. I've tested it locally. Unfortunately, I'm not able to run tests for the current version of this project because it involves external dependencies that I don't have and don't want to install (Cloud SDK). (Also related #470.) |
@shantuo Are you planning to do a redeploy? It doesn't look like the commit that fixed this is live on godoc.org yet. |
Yes, there was some other issue with the deployment. I will try to cherrypick this change in and redeploy it first. |
I can confirm it's fixed on https://godoc.org now. The "Package Files" link at https://godoc.org/github.com/google/go-querystring/query, after refreshing the package, points to https://github.com/google/go-querystring/tree/master/query. Packages will need to be refreshed for the fixed link to take effect. That should happen over time gradually as people push update/refresh. |
To reproduce, visit:
https://godoc.org/github.com/google/go-querystring/query
Find the "Package Files" link.
Clicking it gives 404.
The link is wrong. It points to:
https://github.com/google/go-querystring/tree/query
But it should point to:
https://github.com/google/go-querystring/tree/master/query
Where
master
is the default branch (which might not necessarily bemaster
).Cause
It happens only for packages that are in subdirectories, and located on GitHub. The bug is in the
gosrc
package:gddo/gosrc/github.go
Line 161 in 8468220
It should be something like:
Where
{defaultBranch}
is the default branch. I'm not yet sure if we already have access to that value somewhere, or if we need to do something to retrieve it (hopefully, without additional API calls).gosrc.bestTag
is definitely relevant here.The text was updated successfully, but these errors were encountered: