Allow import of dependencies from govendor #710
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This will allow import of existing dependencies tracked via govendor.
Transitive dependencies
One caveat I bumped into while testing this out with
hashicorp/terraform
is that govendor (as opposed to glide) allows transitive dependencies to be pinned to different versions to what the original 1st level dependency requires.I couldn't find any real benefit of that feature - in fact I think it's better if this treated as a conflict - like it is in Glide.
To solve this in most graceful way I decided to generate initial
glide.yaml
file which may not be error-less for the first time, but will include all dependencies and 1stglide update
will report any conflicts and let the user resolve these, e.g.Version
vsVersionExact
There are 2 main fields that may define the pinned version.
Version
is typically more loose (v1
which will match latestv1.*.*
tag or branch) andVersionExact
is exact match (typically resolvedVersion
). I decided to give priority toVersionExact
as I came to the conclusion that user is more likely to benefit from dependency versions that are as close to previous versions as possible.