-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: wrong file links for submodules #56666
Comments
When I tried to go get
@golang/pkgsite @golang/tools-team Doesn't pkgsite use the directory root info retrieved from the |
We do, code is at https://go.googlesource.com/pkgsite/+/refs/heads/master/internal/source. |
Reading the tests from https://go.googlesource.com/pkgsite/+/refs/heads/master/internal/source, I don't see a nested example for github.com. Hence, I don't really know what to do with our use case. |
What is the reason to use a different repo root in the For example, cloud.google.com/go/storage is a submodule of cloud.google.com/go. When I run
|
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
@jamalc, sorry we missed that issue along the way. We'll make sure it doesn't happen again 🙏 Thanks for your insights. To answer your question:
Dagger is a monorepo, in which several projects are being versioned. More specifically, 2 tools needed to be versioned inside this repo with potentially different versions (with several This implementation caused us lots of issues around the versioning of both tools, and we ended up creating a mirror repo which is basically the When checking the curl https://dagger.io\?go-get\=1
<!DOCTYPE html>
<html>
<head>
<meta
name="go-import"
content="dagger.io/dagger git https://github.com/dagger/dagger-go-sdk"
/>
<meta
name="go-source"
content="dagger.io/dagger https://github.com/dagger/dagger/tree/main/sdk/go https://github.com/dagger/dagger-go-sdk/tree/main{/dir} https://github.com/dagger/dagger-go-sdk/blob/main{/dir}/{file}#L{line}"
/>
<meta http-equiv="refresh" content="0; url=https://github.com/dagger/dagger">
</head>
</html> We see that we ask the users to download from our mirror, in which we are able to freely version the tool: name="go-import"
content="dagger.io/dagger git https://github.com/dagger/dagger-go-sdk" But, as it is a read-only repo, and using the fact that we would love to centralize any issue on our main monorepo, it would be nice to be able to redirect to the main real implementation of the SDK, when users click on files :
Regarding your
When going to check the test package on pkg.go.dev, and with above configuration, we see that your first When clicking on any of the links, it redirects to the first url specified in the go-source, it redirects indeed to the first url mentioned: Do you think it is possible to have different first url for the It is surely an issue on our side, but any guidance is welcomed 😇 |
Can we please re-open this issue ? 🙏 |
We can re-open but there is currently no support. The second field in the go-source meta tag should be the repository homepage. You have listed a subdirectory. See more info on this wiki page about the go-source meta tag. |
We're testing our new approach (using redirect directly on the module url). We can close for now. |
What is the URL of the page with the issue?
https://pkg.go.dev/dagger.io/[email protected]#section-sourcefiles
What is your user agent?
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0
Screenshot
What did you do?
Clicked on the
error.go
file linkWhat did you expect to see?
It should have led me to: https://github.com/dagger/dagger/blob/sdk/go/v0.4.0/sdk/go/error.go
What did you see instead?
https://github.com/dagger/dagger/tree/main/sdk/go/blob/v0.4.0/error.go
Fix
Issue
it seems when using a submodule with the correct way of tagging it (with a tag containing its subdirectory location), the pkgsite doesn't concatenate the relative to repository root path of the file, but only relative to its respective
go.mod
submodule.The text was updated successfully, but these errors were encountered: