Skip to content

fix(ci-compliance): survive a dataset file the engine throws on, and say so on a skip - #33

Merged
sakanni merged 2 commits into
developfrom
CI_Toolkit-#32-DatasetRunnerPerFileCatch
Oct 18, 2026
Merged

sakanni merged 2 commits into
developfrom
CI_Toolkit-#32-DatasetRunnerPerFileCatch

Conversation

@sakanni

@sakanni sakanni commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

Issues addressed by this PR

Closes #32

DatasetComplianceRunner gets the per-file catch ComplianceRunner got in #28. A file the engine throws on is counted as failed, annotated by name, and the run carries on and fails on the failure count, instead of the exception escaping Main and killing the process before any output is written.

The failure annotation moved from ComplianceRunner into Compliance.Shared so one reword cannot land in one runner and not the other. No wording change.

Second commit is the skip half: a compliance job that self-skips now writes a job summary line naming the pathspec it searched. compute-changed-files gains a reason output so that line can tell an empty diff from a run that was never a pull request. Additive, and no behaviour change for its other consumers.

Test files

Two end-to-end tests in DatasetComplianceRunnerE2ETests hold a dataset file open with no sharing, which is what reaches the throw, and assert the run fails, names the file, keeps the coverage line, and still reports the other file's finding. Four hermetic tests pin the shared annotation's wording and level. Six Pester assertions cover the skip summary and the reason output at both ends.

Existing tests are unmodified. Reverting the runner change fails the two new end-to-end tests and nothing else.

Changelog

A dataset file the compliance check cannot read no longer discards every other file's findings in the same run, and a skipped compliance check now says what it looked for.

IsValidDataset opens the file with an unguarded StreamReader before it parses
anything, so an exception does not need a malformed dataset to reach it. There
was no catch around the per-file work, so the exception escaped Main and killed
the process before OutputEmitter ran: no annotation, no coverage line, no name
for the file that caused it, and the findings already gathered for every other
file in the run were lost.

Same shape as the ComplianceRunner catch, with the failure annotation moved to
Compliance.Shared so one reword cannot land in one runner and not the other.
The run still fails on accounting.Failed, so this states the abort rather than
making the check more permissive.
… for

A self-skip is correct behaviour: the check reads only the files a pull request
changed, so no dataset files changed means nothing to examine. The result did
not say so. Every step after the diff is skipped, the runner never runs, and
its coverage line is the only thing that reports what was examined, so the job
summary was empty and a green with nothing to check read the same as a green
that checked everything.

Adds a summary line naming the pathspec that was searched, because the one way
a skip is wrong is the pathspec missing a file that did change. compute-changed-files
gains a reason output so the line can tell an empty diff from a run that was
never a pull request, which the count alone collapses.
@sakanni
sakanni marked this pull request as ready for review October 18, 2026 17:42
@sakanni
sakanni merged commit b7aeeec into develop Oct 18, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci-dataset-compliance: neither a crash nor a skip reports what it did

1 participant