fix(dependabot): report why a PR read failed, not just that it did - #132
Merged
Conversation
The first real run failed on nightowlstudiollc/kebab-tax-netlify#280 with "could not read PR detail" and nothing else. The reason was unrecoverable: `2>/dev/null` discarded GraphQL's stderr, and the body's `errors` array was never inspected. That turned a diagnosable permission failure into guesswork about token grants — none of which was testable locally, because a local login reads the repo fine. Both channels now surface, because GraphQL uses both: transport failures land on stderr, while query-level errors (FORBIDDEN, NOT_FOUND, RATE_LIMITED) come back in the response body with HTTP 200 and exit 0. The failure itself was correct behaviour — collect.sh refused to emit a partial survey, and run-digest.sh refused to publish one. The digest's whole premise is that nothing goes unseen, so a silent omission is the one outcome it must not produce. This change does not alter that; it only makes the refusal explain itself. Claude-Session: https://claude.ai/code/session_01ESsw699T54JHARkQXrdL3o
|
Reviewed against BLOCK criteria (bugs, reliability regressions, security vulnerabilities, missing error handling, data loss). Temp file lifecycle is correct: created once per loop iteration, cleaned up in both error path (before No BLOCK-level issues found. VERDICT: PASS |
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 happened
The first real digest run failed, and the error message made it undiagnosable:
That is all it said. The refusal was correct — a partial survey is the one
output this tool must never produce — but "could not read" gave nothing to act
on, and the cause is not reproducible locally: a personal login reads that repo
and that PR over GraphQL without trouble.
The defect
2>/dev/nullon the GraphQL call discarded the reason, and the response body'serrorsarray was never inspected. GraphQL uses both channels — transportfailures go to stderr, while query-level errors (
FORBIDDEN,NOT_FOUND,RATE_LIMITED) come back in the body with HTTP 200 and exit 0. Both nowsurface.
Review caught a real bug in the fix
The adversarial reviewer flagged the error formatter itself:
+binds tighter than//in jq, so that parses as.type // ("?: " + .message)and prints a bare
FORBIDDEN— dropping the message, which is the entirepayload this change exists to print. Confirmed by measurement, not by reading:
tests/test-render.shnow extracts the formatter fromcollect.shand runs itagainst a real error body. Validated against the known-bad form, where it fails
with
the error formatter dropped part of the error: 'FORBIDDEN'.What this does not do
It does not fix the underlying access problem, because that problem is not yet
identified. It makes the next run say what the problem is. The three tokens
were all created the same way against all repositories, and the failing repo is
indistinguishable from the two that succeeded — same owner, private, not a
fork, not archived — so the answer has to come from GitHub's own error text.
Advances #120.
https://claude.ai/code/session_01ESsw699T54JHARkQXrdL3o