Exit non-zero when a file cannot be processed - #55
Open
MPV wants to merge 1 commit into
Open
Conversation
MPV
force-pushed
the
claude/execute-returns-error
branch
from
July 23, 2026 07:14
dea6982 to
c060823
Compare
MPV
force-pushed
the
claude/execute-returns-error
branch
from
July 23, 2026 08:17
c060823 to
b3973cd
Compare
This was referenced Jul 23, 2026
MPV
force-pushed
the
claude/execute-returns-error
branch
from
July 23, 2026 08:46
b3973cd to
d81dee0
Compare
Per-file processing errors were logged but the process still exited 0, so a pipeline like `kir manifests/* | xargs grype` could not tell that some manifests failed to parse — exactly the kind of silent gap that matters for a tool feeding a vulnerability scanner. Count per-file failures and, after processing every file, return an error so main exits non-zero. Files that succeed are still printed; only the exit status changes. The change is visible in the cmd approval suite: TestExecuteFileFailure's stderr golden goes from empty to "1 of 2 file(s) could not be processed". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pc6NAURAqjU4LYJx93tgSC
MPV
force-pushed
the
claude/execute-returns-error
branch
from
July 24, 2026 06:45
d81dee0 to
52bfab2
Compare
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.
What
Count per-file processing failures and, after processing every file, return an error so
mainexits non-zero. Files that succeed are still printed.Why
Per-file errors were logged but the process still exited
0, so a pipeline likekir manifests/* | xargs grypecouldn't tell that some manifests failed to parse — exactly the kind of silent gap that matters for a tool feeding a vulnerability scanner.Behavior change
A run where any file fails now exits non-zero (was
0). Output for the files that succeeded is unchanged.How it reads in review
The change surfaces as a golden diff in the cmd approval suite:
TestExecuteFileFailure's stderr golden goes from empty →1 of 2 file(s) could not be processed. (This is why #50 converted the cmd tests to stdout/stderr approvals first.)Stack
Base:
claude/execute-returns-error(#50). Merge order: #59 → #50 → this →claude/error-missing-files(#57).🤖 Generated with Claude Code
https://claude.ai/code/session_01Pc6NAURAqjU4LYJx93tgSC