fix(cli): distinguish GitHub lookup failure from empty submissions (#1492)#1554
Merged
Conversation
…ntrius#1492) `find_prs_for_issue` collapsed the GraphQL failure sentinel (`None` from `_search_issue_referencing_prs_graphql` on rate limit / network / GraphQL errors / missing issue payload) into `[]` via `return prs or []`. Downstream, `gitt issues submissions --json` then emitted a successful response with `submission_count: 0`, indistinguishable from a genuinely empty list — a false negative for bounty submitters and `--json` automation. - `find_prs_for_issue` now returns `Optional[List[PRInfo]]`, propagating `None` on lookup failure (including the exception path), consistent with the `solver_lookup_failed` signaling in `find_solver_from_closure_event` / `check_github_issue_closed`. A falsy token still returns `[]` (precondition-not-met, not a transient failure). - `fetch_open_issue_pull_requests` propagates the `None` sentinel. - `issues submissions` surfaces it via `handle_exception` as a `github_lookup_failed` error (JSON and human modes) instead of reporting an empty submission list. - Typed `handle_exception` as `NoReturn` (it always raises) so callers narrow correctly. - Tests: `None`/exception lookup failures now assert `None` (not `[]`); added CLI coverage for the JSON and human failure paths. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
This closes #1492 by giving Beyond the shared
Tests cover both the JSON ( |
4 tasks
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.
Closes #1492
Problem
find_prs_for_issuecollapsed the GraphQL failure sentinel (Nonefrom_search_issue_referencing_prs_graphqlon rate limit / network / GraphQLerrors / missing issue payload) into
[]viareturn prs or []. Downstream,gitt issues submissions --jsonemitted a successful response withsubmission_count: 0— indistinguishable from a genuinely empty list. Bountysubmitters and
--jsonautomation get a false negative when GitHub lookupsactually fail.
Fix
find_prs_for_issuenow returnsOptional[List[PRInfo]], propagatingNoneon lookup failure (including the exception path), consistent with the
solver_lookup_failedsignaling infind_solver_from_closure_event/check_github_issue_closed. A falsy token still returns[](precondition-not-met, not a transient failure).
fetch_open_issue_pull_requestspropagates theNonesentinel.issues submissionssurfaces it viahandle_exceptionas agithub_lookup_failederror (JSON + human modes) instead of an empty list.handle_exceptionasNoReturnso callers narrow correctly.Tests
None/exception lookup failures now assertNone(not[]).ruffclean,pyright0 errors, 320 tests pass.