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: lower score of previous path in case of module rename #37252

Open
myitcv opened this issue Feb 16, 2020 · 9 comments
Open

x/pkgsite: lower score of previous path in case of module rename #37252

myitcv opened this issue Feb 16, 2020 · 9 comments

Comments

@myitcv
Copy link
Member

@myitcv myitcv commented Feb 16, 2020

What is the URL of the page with the issue?

https://pkg.go.dev/github.com/myitcv/govim/cmd/govim/config?tab=doc

What is your user agent?

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.66 Safari/537.36

Screenshot

Screen Shot 2020-02-16 at 20 02 26

What did you do?

Visited the above page.

What did you expect to see?

Expected to see v0.0.29 as the latest version.

What did you see instead?

Saw v0.0.22 which was released a long time ago:

Screen Shot 2020-02-16 at 20 03 13

@myitcv
Copy link
Member Author

@myitcv myitcv commented Feb 16, 2020

Hmm, the latest version updated soon after I did a go get via the proxy. For this particular module, most people end up cloning the repo via a Vim plugin manager. So I guess the lesson here is that I need to semi-regularly do a go get for latest via the proxy?

@myitcv
Copy link
Member Author

@myitcv myitcv commented Feb 16, 2020

Very embarrassing. I was looking with my eyes shut.

Prior to being github.com/govim/govim the module was github.com/myitcv/govim. The search results for govim pull back both, and I was not careful enough in spotting which module I was looking at. The flip happened post v0.0.22, hence the confusion.

In situations like this, is there some way that the module own can indicate to pkg.go.dev that a rename has happened? Such that the new module path always ranks higher than the old module path?

@myitcv myitcv changed the title go.dev: latest version for a package is very stale go.dev: lower score of previous path in case of module rename Feb 16, 2020
@bcmills
Copy link
Member

@bcmills bcmills commented Feb 19, 2020

See previously #37187.

@myitcv
Copy link
Member Author

@myitcv myitcv commented Feb 19, 2020

Thanks @bcmills

Hmm, that's interesting. That's uncovered what I consider to be a problem with the proxy.

export GOPATH=$(mktemp -d) 
cd $(mktemp -d) 
go mod init mod.com
go get github.com/myitcv/govim@latest

gives:

go: downloading github.com/myitcv/govim v0.0.29
go: github.com/myitcv/govim latest => v0.0.29
go get: github.com/myitcv/govim@v0.0.29: parsing go.mod:
        module declares its path as: github.com/govim/govim
                but was required as: github.com/myitcv/govim

i.e. the proxy considers that versions > v0.0.22 (the point at which the module path changed) as being valid for github.com/myitcv/govim, even though all such versions actually correspond to github.com/govim/govim.

Or have I missed something here?

@bcmills
Copy link
Member

@bcmills bcmills commented Feb 19, 2020

In general a module with a mismatched module path may be intended for use with a replace directive for the corresponding module. So the proxy probably shouldn't reject those out-of-hand.

It does appear that pkg.go.dev successfully suppresses the documentation for mismatched versions. (https://pkg.go.dev/github.com/myitcv/govim?tab=versions ends at v0.0.22.)

@myitcv
Copy link
Member Author

@myitcv myitcv commented Feb 19, 2020

In general a module with a mismatched module path may be intended for use with a replace directive for the corresponding module. So the proxy probably shouldn't reject those out-of-hand.

Of course. Totally forgot about that, thank you.

@myitcv
Copy link
Member Author

@myitcv myitcv commented Mar 5, 2020

Interestingly, https://pkg.go.dev/search?q=govim now no longer shows any results from the previous module path:

Screen Shot 2020-03-05 at 12 03 48

Given @bcmills' observations above, I would have expected the results for github.com/myitcv/govim to still appear, but simply be ranked lower.

Was there a change here, @julieqiu?

@julieqiu
Copy link
Contributor

@julieqiu julieqiu commented Mar 11, 2020

@myitcv - seems like this is related to #37187.

Closing this issue since it seems #37252 (comment) has been addressed. Feel free to reopen if that is not the case!

@myitcv
Copy link
Member Author

@myitcv myitcv commented Mar 13, 2020

@julieqiu - there is now a slightly different issue, per #37252 (comment), despite https://pkg.go.dev/github.com/myitcv/govim?tab=doc being a valid package (which should match the search term "govim")

@myitcv myitcv reopened this Mar 13, 2020
@julieqiu julieqiu changed the title go.dev: lower score of previous path in case of module rename x/pkgsite: lower score of previous path in case of module rename Jun 15, 2020
@julieqiu julieqiu added the UX label Jun 15, 2020
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
You can’t perform that action at this time.