fix: exclude symlinks to directories from hashing #1044
Merged
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 this PR does / why we need it:
This PR fixes #1029, which was caused by bad handling of symlink when initializing garden.
Which issue(s) this PR fixes:
Fixes #1029
Special notes for your reviewer:
We use the git client to retrieve all the files from a project, from where to extract then the module config paths. The current implementation then doesn't allow the use of symlinks: the git client will never resolve a symlink if it's a directory. It will always treat it as file and (this is now fixed/prevented) would try to hash it using the node streams, failing.
From a design point of view, I am not 100% aware of all the reasons behinf choosing
git ls-files
instead of something else. What I find strange is the jump from "using a library" to retrieve files and "using bare node streams" to hash it. It would be nice to understand if it makes sense to convert the search function to the same node standard or viceversa if we can use the git client to do the hashing.Does this PR introduce a user-facing change?:
No