-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
proxy.golang.org: stop serving /@v/branchname.info when the branch is deleted #49146
Comments
Isn't the whole point of the proxy to keep serving things that have been deleted? |
For tags and semver versions, I definitely agree. For branch names, I'm not that convinced. A branch is a moving target by definition. An alternative would be to build special knowledge that, if |
My personal preference (not go proxy or go command teams' opinion) is not to proxy or cache any version query string (e.g. tags, commit hash, branch name), and let proxy.golang.org just return 404/410 with a long TTL for such queries. I'd also like the go command to just automatically switch to |
This argument could be made if the repository is deleted as well. If the entire repository was deleted should sqlc@master return anything? I think @hyangah argument is more consistent. |
I don't think the (But I do agree that it would be fine for |
It may also be possible to change |
Coming to this over two years later, but: the proxy should continue serving semver versions practically forever, unless there's something serious like a takedown notice or licensing issue. Otherwise, one pillar of reproducible builds falls down. I still think that branch names do not fall under that category, because they're not used by MVS nor commands like I personally don't mind whether this detection of "branch deleted" happens in the proxy or in |
I just had a very confusing experience using modules for a solid hour, which was all caused because one of the tools I use renamed their HEAD branch from
master
tomain
and I hadn't noticed.I was happily running
go install github.com/kyleconroy/sqlc/cmd/sqlc@master
, and it was working. I ran into some weird behaviors which should have been fixed in the latest development version, which was odd. I later found out viago version -m $(which sqlc)
that my version was half a year old, even though HEAD had a commit just days ago.Ah! The HEAD branch is now
main
. But why is@master
still happily giving me an old version, when upstream deleted their branch? Surely, upstream deleting their old HEAD branch is as much as they should do to make things right.Turns out that the problem is that
proxy.golang.org
is remembering the lastmaster
version it saw, presumably forever:You can see it frozen in time at https://proxy.golang.org/github.com/kyleconroy/sqlc/@v/master.info.
I strongly believe the proxy server should not do this. I realise that tagged versions are effectively treated as read-only once pushed by the proxy and index servers, but I understand that branches aren't meant to work that way. If a branch vanishes from upstream, I think its
.info
file should reflect that, just like/@v/missing.info
givesinvalid version: unknown revision missing
.This issue is slightly similar to #39007, but also different - in my case, the module is healthy, but just not at that branch anymore.
The text was updated successfully, but these errors were encountered: