Conversation
The CI script to ensure no LavaMoat policy changes are required has been failing despite there being no changes. It turns out that the command used to check for changes (`git diff-index`) was failing despite the lack of changes because the file was written again by `yarn lavamoat:auto` but git hadn't gotten around to updating its index since the write occurred, so it was considering it as changed until it verified it wasn't [1]. The command has been replaced by `git diff --exit-code --quiet`, which should do exactly the same thing except that it forces git to update its internal cache to verify whether changes are present. [1]: https://stackoverflow.com/questions/34807971/why-does-git-diff-index-head-result-change-for-touched-files-after-git-diff-or-g
Member
Author
|
I was able to test this by running the command: The command printed "failed" demonstrating a non-zero exit code. I tested the new command like this: The "failed" message was not printed, demonstrating a zero exit code. |
Collaborator
Builds ready [95bdb1c]
Page Load Metrics (610 ± 41 ms)
|
Contributor
|
Worked as described! |
darkwing
approved these changes
Feb 25, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The CI script to ensure no LavaMoat policy changes are required has been failing despite there being no changes. It turns out that the command used to check for changes (
git diff-index) was failing despite the lack of changes because the file was written again byyarn lavamoat:autobut git hadn't gotten around to updating its index since the write occurred, so it was considering it as changed until it verified it wasn't.The command has been replaced by
git diff --exit-code --quiet, whichshould do exactly the same thing except that it forces git to update its internal cache to verify whether changes are present.