-
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: invalid versions for subdirectories #51720
Comments
go treats The second issue is working as intended, go modules match to the longest module name. |
Thanks for the quick response @seankhliao :) To clarify As far as I can see all other go tools seem to work as expected. So for example if I use github.com/gomodule/redigo/redis in a package and run go mod tidy
go: finding module for package github.com/gomodule/redigo/redis
go: found github.com/gomodule/redigo/redis in github.com/gomodule/redigo v1.8.8 go get -v github.com/gomodule/redigo/redis@latest
go: added github.com/gomodule/redigo v1.8.8 Prior to adding the retract to the So unless I'm missing something, it seems like
To clarify when you say second issue do you mean the versions not listing correctly? If so this isn't how something like testify/require is working and hence shows the versions associate with parent. |
The redis submodule certainly existed at some point: https://github.com/gomodule/redigo/blob/e14091dffc1b085ace903ff7c41916e17c2daca3/redis/go.mod The only way to fix this is to properly retract the redis module, serving a module without files like the |
Thanks for the clarification on why pkgsite is special, makes sense. The blog article details how to retract a module which has been tagged, but not clear how to do the same for one that has never been tagged. I thought I understood your statement:
To mean that we would need a redis/go.mod and redisx/go.mod with:
But re-reading I'm not sure this was your intention? |
I can't speak to the right way to do this, but I thought that "you can file a request for the pkgsite team to remove your package" from https://pkg.go.dev/about#removing-a-package might be a workable approach? gomodule/redigo#604 kinda scares me. |
you would need:
and tag it as
The next commit has to be to remove the file (unless you do it on some other branch and just leave it there). Removing a module by request will likely impact the module you want to keep as it shares a path. |
Thanks again @seankhliao I've prepared a PR that includes the changes you suggested. Note that no As @pabigot mentioned I'm not totally comfortable with this as if it doesn't work or creates any unintended impact, I don't know a way to fix as the tag v0.0.1 will exist, which isn't ideal. |
The tag only needs to exist long enough for the proxy to index/cache it. If you do it wrong, bump up the version and try again, the retractions at the highest version are the ones take effect. |
Is there a way to force the proxy to index/cache it? |
For those which might find this issue I managed to trigger the index to cache it by manually visiting: Thanks @seankhliao for the help in figuring out how to fix. |
What is the URL of the page with the issue?
https://pkg.go.dev/github.com/gomodule/redigo/redis
What is your user agent?
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36
Screenshot
First go to the URL directly
Second clicks the sub directory link from the main repo, which shows the latest link in red indicating the link from latest gomodules/redigo doesnt link to the latest gomodules/redigo/redis which should be the same.
Versions aren't listed in the sub directory:
What did you do?
Two flows:
Issue 1
Issue 2
What did you expect to see?
Sub directories in repos use the latest version by default.
What did you see instead?
Sub directories doesn't even list any version
Relevant information
We redigo have an experimental v2.0.0 branch before go modules we're introduced which has been challenging. With the introduction of retract in v1.16 we recently retracted this version in this commit so wondering if this is an edge case which pkgsite isn't dealing with?
Thanks for pabigot for raising this gomodule/redigo#602
The text was updated successfully, but these errors were encountered: