This repository was archived by the owner on Sep 9, 2020. It is now read-only.
WIP: Check if project is missing from vendor during ensure #884
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.
What does this do / why do we need it?
Currently it appears (see #883) that a project missing from the vendor directory isn't added during a
dep ensure
.What should your reviewer look out for in this PR?
Everything, this is my first contribution, importantly, the original issue needs to be verified first. Then is this the best way and location to do this behaviour.
It's a WIP until the issue can be verified first.
Do you need help or clarification on anything?
The error handling from
fs.IsNonEmptyDir
, it's not clear how we should handle these errors (log the error and continue, or try and delete the directory?).The verbose logging, I couldn't find nearby examples of best current practices, so I've just made it up. I think we should log this behaviour, but is this the correct logger, format, message and terminology (
vendor path
orvendor tree
or something else)? Currently only one message will be written and then the loop is broken, so the message instead be%q (and potentially more) needs to be added to vendor path
?Commit message needs to be verified.
No tests are included, as this is pretty critical behaviour, I presume an integration test or similar would be in order?
Which issue(s) does this PR fix?
Fixes #883.