Repository navigation
fix(comments): require a complete status record - #17
Merged
Merged
Conversation
The scanner records each command's exit status in a file and reads it back. A write that stopped after the first digit left a bare number, which read as a valid status and could pass the check unchecked. Write the status as "<digits> done" with a newline, and accept only that exact form. The reader keeps the final newline by appending a sentinel before command substitution strips trailing newlines. Anything else fails with the existing "could not record the exit status" error. The self-test plants partial records and expects each one to fail. Refs dmfdeploy/dmfdeploy#768 Signed-off-by: znerol2 <6800371+znerol2@users.noreply.github.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The review-history check writes each
git grepexit status to a small file and reads it back. The reader accepted a bare leading number, so a write cut short after1would read as "no match" and skip the scan.<status> donefollowed by a newline.read_statusreads the raw bytes and accepts only that exact form. Anything else fails the check with the existing error.The scanner matches the other repos' copies. Only this repo's
excludelist differs.Testing
bin/check-review-comments.sh --self-testpasses. It plants the partial records1,1 doand1 donewithout a newline, and expects exit 1. All three fail with exit 0 against a reader that accepts a leading number.bin/check-review-comments.shgives the same result as before this change.shellcheck bin/check-review-comments.shis clean.Refs dmfdeploy/dmfdeploy#768