Repository navigation
fix(ci-compliance): survive a file the engine throws on - #28
Merged
sakanni merged 3 commits intoOct 16, 2026
Merged
Conversation
A rule that threw escaped Main and killed the process before any output was written. The check went red, which is right, but it named no file, emitted no coverage line, and discarded the findings already gathered for every other file in the run. Catch per file: count it, emit an annotation naming the file, and carry on. The run still fails, now on the failure count rather than by dying.
The first crash test runs a second file carrying a real violation, so the run exits 1 on the merged Error regardless. A mutation removing the failure term from the exit code survived it. This runs the unanalysable file on its own, where nothing else can make the run red.
sakanni
marked this pull request as ready for review
October 15, 2026 13:50
This was referenced Oct 18, 2026
sakanni
deleted the
internal-tickets-#58-CatchPerFileInComplianceRunner
branch
October 19, 2026 09:18
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.
Issues addressed by this PR
Closes #29
A compliance rule that throws on one file took the whole run with it. The check went red, which is right, but it named no file, wrote no coverage line, and discarded the findings already gathered for every other file in the run.
The runner now catches per file: it counts the file, emits an annotation naming it, and moves on. The run still fails, on the failure count rather than by dying.
This came out of a crash caused by a preprocessor directive, but it is not specific to that. Any file that parses malformed can reach the same place.
Test files
FileAccountingTestsandComplianceRunnerE2ETests, 6 new tests and 3 updated. 104 passing inCompliance.Unit.Testsand 72 inCompliance.Tests, existing tests unmodified. Seven mutations run, all caught.Also checked end to end on a throwaway sandbox pull request running this branch: the check fails, the unanalysable file is named, and the other file's violation is still reported.
Changelog
A compliance rule that throws on one file no longer ends the run. The check still fails, and it now names the file and keeps the findings for every other file.
Additional comments
Read
ComplianceRunner.cswith whitespace ignored. Wrapping the loop re-indented it, so the raw diff is around 230 lines where the change is about 40.The two dataset runners share the shape and are not covered here. Neither parses C#, so neither is exposed to this fault.