-
Notifications
You must be signed in to change notification settings - Fork 505
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
Failing to go get package by revision #699
Comments
I'll take this one |
So the problem is that
nothing gets downloaded.
to get the pseudo version determined by go (in this case v0.8.1-0.20161029093637-248dadf4e906) and then
The question is when and where should this be done? I was thinking about those 3 solutions:
I'm leaning toward 3. because we have the whole singleflight/pool logic in place there but I would like to hear what others think. /cc @gomods/maintainers @gomods/contributors |
i would go with option 2. have a middleware intercepting calls to all endpoints except list then it needs to check whether or not it is a commit hash, if it is, it translates and redirects to correct one? |
I like 3rd the best because it is just |
Middlewares would not work since they take the version from the path
(inside the buffalo context), so changing the version to be passed down
would be difficult.
We would need to do the translation (hash to pseudoversion) at least in the
handlers, where the version gets usable via `getModuleParams` or below (as
per case 3).
In any case, I would condition the extra work of go - listing only if the
version is a commit hash.
…On Thu, Sep 27, 2018 at 3:09 PM Manu Gupta ***@***.***> wrote:
I like 3rd the best because it is just go mod download that does not
support hash commits. I like it because
A) It is easier to read the code
B) It does not introduce latency in other parts of the code.
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
<#699 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAMPcPRKoTqLtkaVYXRvK5rMITA8wqHZks5ufM36gaJpZM4W2vg7>
.
--
--------
Federico
|
This is the reason I suggested returning redirect. |
Sorry, I misinterpreted your proposal.
Redirect sound good as well then. It would be a single-purpose middleware
which does not sound that bad.
…On Thu, Sep 27, 2018 at 3:57 PM Michal Pristas ***@***.***> wrote:
This is the reason I suggested returning redirect.
fetcher implementation sounds also good
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
<#699 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAMPcPkZHYl47QnB-mHmHQQEseetVIZEks5ufNlfgaJpZM4W2vg7>
.
--
--------
Federico
|
Why not open this issue on the Go repository and make |
Thanks for the feedback! |
Agree.
Can I work on this?
Il dom 30 set 2018, 21:48 marpio <notifications@github.com> ha scritto:
… I'll go with the middleware since it will be easier to remove once
golang/go#27947 <golang/go#27947> is fixed.
Also the 3rd option would require passing the pseudo version from the
go_get_fetcher/stasher, all the way up to the download protocol (to get it
from the storage) which would make the code less readable.
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
<#699 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAMPcLl9iswi2XLzMrUzv2dVr2ma4gSbks5ugSATgaJpZM4W2vg7>
.
|
@fedepaol sure, it's yours! |
I have a couple of concerns here (briefly mentioned in the PR):
I think we should hold off on this issue until we answer all of these questions, and maybe until |
I do agree with you on all the line. When working on #744 I thought that caching the hash - pseudoversion mapping would have been an optimization. What we could do is to cache the mapping somewhere (and leave the middleware there) OR moving the hash - semver resolution inside the go_get_fetcher so that if a hash is asked it uses the resolved pseudoversion in place of it. This would make it work transparently until the mod download gets fixed. I also need to take a look at how go mods behaves with |
When go download gets fixed we will have another problem - with the current logic we will save the module as a long hash which is not what we want (the go.mod entry is a pseudo version) so we will probably still need to figure out how to go from hash->pseudo_version. |
Again, I see two alternatives here.
Given what @marpio said, I am afraid we need to store that mapping somewhere whatever direction we decide to take. |
True. However, Athens will not save the version in storage under So, as you said towards the end, we need to figure out how to go from hash to pseudo before persisting, and also retrieving a pseudo from hash from storage and not just upstream. Lastly, as I mentioned before: we need to do that not just for hashes but for branch names: I think we should pause and think about this a little bit more. This will certainly add a lot complexity to make one feature work. For example, for beta: maybe it's ok to not allow hashes/branches to be fetched. The hash/branch |
I might be missing something but the the redirect middleware @fedepaol implemented should prevent that from happening, no? |
The middleware solves the hash problem. It redirects to the pseudover so the only entry in the storage is related to the pseudoversion. What's missing is the persitence of the map between the commit hash and the vcs in order to be complete. @marwan-at-work's looked far than us (me) and raised the problem of master / named branches which is something I think needs to be discussed carefully. When a user asks for master, wants the head of the master, that could move during the time. If we translate master to a pseudoversion, and remember that mapping, we freeze "master" forever, even if another user from another codebase comes two years later and ask the proxy to resolve "master" again, not expecting a two years old master. For this reason, my opinion about master / branches is that they should not be persisted at all and that we should refuse the requests pointing to them (or serve them from the vcs every time). If a user wants to use athens, he needs to point specific commits (or tags) of a depndency because he wants the build to be reproducible. |
@fedepaol |
@marpio agree. What I mean here is that we just can't store a map between Do agree with let's postpone this and think about it carefully . |
For beta ( cc/ @marwan-at-work |
We decided in the Oct. 25 meeting that we're going to write docs explaining the limitation, and fix this for |
The go issue for ref: golang/go#27947 |
I'm going to take this out of the |
When I try to
go get
a package by its revision number then I get 500 Internal Server Error.To Reproduce
GOPROXY=http://127.0.0.1:3000 go get github.com/pkg/errors@c059e472caf75dbe73903f6521a20abac245b17f
Expected behavior
Installation of the specified version of
github.com/pkg/errors
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: