feat: report did-not-run checks as their own result - #7
Merged
Merged
Conversation
kapi check exits 4 when a check did not run. The check step still fails with that code, and now sets result=did_not_run and did_not_run_cause and names the cause in its error annotation and job summary. The cause is read from the report kapi printed: the JSON or YAML key, or the "(cause)" that ends the text sentence. result is set for every check outcome; exit 0, 3 and other codes behave as before. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VRid8i4qnuNfE7Lio73Uu4
Temporary, reverted in the next commit. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VRid8i4qnuNfE7Lio73Uu4
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VRid8i4qnuNfE7Lio73Uu4
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.
kapi checkexits 4 when a check did not run (neokapi/neokapi#2656, #2661, #2662). The action reported that as "kapi check failed operationally (exit 4)". It still fails the step, and now reports the outcome and its cause.What changed
resultoutput for every outcome:passed(exit 0),failed(exit 3),did_not_run(exit 4) orerror(any other code).did_not_run_causeand prints an::error::naming the cause.checker_invalidreads "a checker failed its canary, so this run's result cannot be trusted";nothing_to_checkreads "there was nothing in scope to check";content_not_checkedhas its own sentence.did_not_run_causefrom a JSON report, the top-level YAML key, or the "(cause)" ending the text sentence, with ANSI color codes removed. No cause, or a value that is not a cause code, reportsunknown. The command line is passed through unchanged.resultoutput.commit: "false", an input the action no longer declares.Tests
test/stub/kapiprints a fixture and exits with a chosen code.test/check-output/are captured from kapi built at neokapi 67d143a61: a pass, a failed ship gate,nothing_to_checkin text, JSON, YAML and color, andcontent_not_checkedfromcheck --ship --gate voicein text and JSON. Thechecker_invalid, future-cause and unreadable-cause fixtures follow the same shapes by hand, since a missed canary cannot be provoked from outside kapi.test/check-outcomes.shruns the action's own step script, read out ofaction.yml, for 15 cases. It asserts the exit code,result,gate,did_not_run_cause, the annotation text, and that kapi receives the caller's arguments unchanged.test.ymladds a job that runs the action throughuses: ./against the stub for 8 outcomes, a job for the harness, andresultassertions on the existing jobs that run real kapi 1.2.0-rc14.No tag or release comes with this PR.
🤖 Generated with Claude Code
https://claude.ai/code/session_01VRid8i4qnuNfE7Lio73Uu4