fix(core): git hash-object errors must be logged for troubleshooting #10134
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.
When executing parallel targets using e.g. run-commands missing entries in .gitignore
may lead to temp files being passed to "git hash-object"
which when git executes have been deleted resulting in
mismatch between number of files requested and hashes returned.
git reports the error and this PR will make sure that report is passed in the error thrown.
This will make problem resolution a lot faster.
ISSUES CLOSED: #9946
Current Behavior
If some directory - e.g.
.npm
- is not present in.gitignore
parallel builds adding and removing files in such a temporary directory may result in these files being passed togit hash-object
.This will show up as an error:
> NX Passed 11161 file paths to Git to hash, but received 11148 hashes.
and the build fails.
Trouble shooting this is a bit hard because there is no hint as to which file(s) were between gathering files and requesting hash calculation.
Expected Behavior
The error output from
git hash-object
will show at least one of the files that could not be hashed.We want this error info in the log along with the current - e.g.