fix: degrade instead of crashing on malformed issue-list JSON in find-issue#24
Merged
Merged
Conversation
…-issue find-issue.ts parsed its input with a bare JSON.parse, diverging from the repo's degradation-over-crashing convention. Route it through readJsonOrNull and an exported findIssueNumber() that treats missing/malformed/non-array input as "no marked issue" (empty output), with tests. Closes #19 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Fixes the last remaining finding from self-audit #19 (the other 5 were fixed in #23).
src/find-issue.tsparsed its input with a bareJSON.parse(readFileSync(...)), diverging from the repo's "degradation over crashing" convention (readJsonOrNullinsrc/finalize.ts). CI currently masks this (the report action writes[]onghfailure), but a malformed local input would throw.findIssueNumber(input: unknown): string— non-array/null input degrades to''(same as "not found")readJsonOrNulltest/find-issue.test.ts(failing first), suite now 27 files / 144 tests green''exit 0, missing →''exit 0, valid → issue numberCloses #19
🤖 Generated with Claude Code