fix(ci): fail vector-result merge on vacuous or inconsistent artifacts#58
Open
yilirong1992 wants to merge 2 commits into
Open
fix(ci): fail vector-result merge on vacuous or inconsistent artifacts#58yilirong1992 wants to merge 2 commits into
yilirong1992 wants to merge 2 commits into
Conversation
A results-<adapter>.json containing {} (or any object with zero checks)
merged into an overall pass, and the artifact's own status field was
ignored, so a run that never executed could green-light CI. Require
every artifact to contribute checks, honor status/count consistency,
and fail on an empty adapter list.
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.
merge_vector_results: reject vacuous or self-inconsistent result artifacts
Summary
The vector-result merger trusted every readable artifact. That leaves a false-PASS
hole in CI: a
results-<adapter>.jsonthat parses as JSON but carries no actualconformance data merges into an overall
status=pass.Reproducible on
mainbefore this change:Concrete ways to hit this:
(truncated-but-valid JSON, or an empty object),
status: "fail"with malformed counts —the merger ignored the
statusfield entirely and only summedfailed.Since branch protection keys on the merged status, any of these silently green-lights
a PR that never ran conformance for that adapter.
What this PR does
Each artifact must now carry real evidence of a run:
[], a bare string, …) are treated like unreadablefiles and recorded as a runner failure for that adapter.
num_checks == 0, including{}) fail with"... reported zero conformance checks". The vector runner always emits atleast one check (it has an explicit
no_checksguard), so a zero-checkartifact can only mean the run did not happen.
status != "pass"butfailed == 0) failsinstead of being ignored — the merger now honors the artifact's own status
field as a failure signal.
--adapterslist produces a failing merge instead of a greenrun with zero checks.
Counting and error propagation for healthy artifacts is unchanged, as is the
$GITHUB_OUTPUTinterface consumed byconformance.ymland the monitor workflow.Tests
New
test_merge_vector_results.py(picked up by the existingunittest discoverstep in ci.yml) covers: healthy merge,{}artifact,zero-check artifact,
status:"fail"with zero counts, non-object payload,missing artifact file, and the empty adapter list. Full script suite:
16 tests, OK.