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: wrong file links for submodules #56666

Open
dolanor opened this issue Nov 9, 2022 · 4 comments
Open

x/pkgsite: wrong file links for submodules #56666

dolanor opened this issue Nov 9, 2022 · 4 comments
Labels
pkgsite WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@dolanor
Copy link

dolanor commented Nov 9, 2022

What is the URL of the page with the issue?

https://pkg.go.dev/dagger.io/dagger@v0.3.1#section-sourcefiles

What is your user agent?

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

Screenshot

Capture d’écran de 2022-11-09 12-27-37

What did you do?

Clicked on the error.go file link

What 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

- https://github.com/dagger/dagger/tree/main/sdk/go/blob/v0.4.0/error.go
+ https://github.com/dagger/dagger/blob/sdk/go/v0.4.0/sdk/go/error.go

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.

@hyangah
Copy link
Contributor

hyangah commented Nov 11, 2022

When I tried to go get dagger.io/dagger?go-get, I see

     <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}"
    />

@golang/pkgsite @golang/tools-team Doesn't pkgsite use the directory root info retrieved from the go-source meta tag? Or is it still waiting for the decision on the proposal #39559 @jba ?

@jba
Copy link
Contributor

jba commented Nov 11, 2022

We do, code is at https://go.googlesource.com/pkgsite/+/refs/heads/master/internal/source.
I retracted that proposal (read the end). I just closed it to avoid confusion.

@suzmue suzmue modified the milestones: Unreleased, pkgsite/later Nov 12, 2022
@dolanor
Copy link
Author

dolanor commented Nov 14, 2022

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.
Is our vanity meta tag setup wrong?

@jamalc
Copy link

jamalc commented Nov 18, 2022

What is the reason to use a different repo root in the go-import tag from the home field in the go-source tag? Can you use the "_" fallback or the same path for the home field in go-source?

For example, cloud.google.com/go/storage is a submodule of cloud.google.com/go. When I run curl https://cloud.google.com/go/storage\?go-get\=1, I see

<meta name="go-import" content="cloud.google.com/go git https://github.com/googleapis/google-cloud-go">
<meta name="go-source" content="cloud.google.com/go https://github.com/googleapis/google-cloud-go https://github.com/GoogleCloudPlatform/gcloud-golang/tree/master{/dir} https://github.com/GoogleCloudPlatform/gcloud-golang/tree/master{/dir}/{file}#L{line}">

@jamalc jamalc added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkgsite WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

6 participants