-
Notifications
You must be signed in to change notification settings - Fork 1k
Godeps.json with extra hash on comment string confuses dep init parsing semver #827
Comments
We have a good-first-bug here 😃. godep importer should parse the
For example: if Refer: https://github.com/golang/dep/blob/master/cmd/dep/godep_importer.go#L141 |
Can I tackle this one for my first contribution? |
@aschlesener that would be awesome 🎉 |
I'm looking at this for fun and have one question. Would appreciate if someone could kick me in the right direction. It seems like the issue is that the version
When the above check is in place, My question is if having the following output in
It looks a bit funny, but is according to |
@aschlesener indeed, feel free to ask away! @sebdah ohhh, INTERESTING. i had a feeling that bzr logic might come back to bite us. Yes, that range should be logically valid, though it may not have quite the desired effect. It's valid semver - |
@sdboyer Thanks for the swift response. In my opinion that would be outside the control of I'm also considering having a regexp instead to validate Would you be fine with the below as the end result, or is there something smarter we can do here that I'm overlooking?
|
💯
Check the git blame on that line - I remember that, in the PR where we added that logic, one of our contributors actually went and read the bzr source code to find out how it generates the identifiers. The right solution here also might be reordering when we check each constraint type. If we look at revisions last, this problem might just go away? |
Thanks for the pointers, will 🔍 |
and, without having looked at sarama's release list, that seems like it would probably be fine. i don't know exactly what your goal is, though, so i'm not sure what the objective function here is by which we'd evaluate "smarter". |
This commit addresses an issue where the godep importer would confuse semver suffixes for being bzr revisions. Now we have stricter checks on the bzr revision checks which will be able to distinguish between semver with a suffix and a bzr revision. The new check enforces bzr revisions to contain an @ symbol. Closes golang#827.
What version of Go (
go version
) anddep
(git describe --tags
) are you using?Go version
go1.7.4 darwin/amd64
Dep Version
v0.1.0-215-g911cd22
Description
Our existing
Godeps.json
has comments that aren't valid semver. For example:The comment has an extra
-44-g3efb95d
, which does not match a tag in Sarama. Dep seems to use the extra hash as the tag, which can lead to the version being not found.Some lines from the output during
dep init
Deleting the hash manually from the comment does allow dep to find the correct version.
Here's a few more examples from our Godeps.json, some values from the
comment
don't reference semver (and still have the extra hash):It looks like Godeps uses
git describe --tags
for the comment field?https://github.com/tools/godep/blob/3c0ccb9a2415fbda40b982b622735906bcd1760f/godepfile.go#L142
https://github.com/tools/godep/blob/3c0ccb9a2415fbda40b982b622735906bcd1760f/vcs.go#L43
Running
git describe --tags
on sarama, I see:v1.11.0-44-g3efb95d
The text was updated successfully, but these errors were encountered: