Description
When GitHub GraphQL cross-reference lookup fails, _search_issue_referencing_prs_graphql correctly returns None (rate limit, network error, GraphQL errors, missing issue payload). The public wrapper find_prs_for_issue collapses that failure sentinel to an empty list via return prs or [].
Downstream, gitt issues submissions --json then emits a successful response with "submission_count": 0 — indistinguishable from a genuinely empty submission list.
This is inconsistent with other paths in the same module that preserve None for retry/failure signaling, e.g. find_solver_from_closure_event and check_github_issue_closed (solver_lookup_failed=True).
Steps to Reproduce
- Set
GITTENSOR_MINER_PAT to a valid token.
- Run
gitt issues submissions --id <active_issue_id> --json for an issue that has open referencing PRs on GitHub.
- Simulate GraphQL failure (rate limit, timeout, or mock
_search_issue_referencing_prs_graphql returning None).
Actual: JSON like:
{"success": true, "submission_count": 0, "submissions": []}
Expected: Lookup failure should be distinguishable from “no submissions exist” — error / retry guidance, not false success.
Affected code
Failure sentinel (correct): gittensor/utils/github_api_tools.py ~272–284 — _search_issue_referencing_prs_graphql returns None on GraphQL failure.
Collapse bug: gittensor/utils/github_api_tools.py ~337:
prs = _search_issue_referencing_prs_graphql(...)
return prs or [] # ← turns None into []
CLI consumer: gittensor/cli/issue_commands/helpers.py fetch_open_issue_pull_requests passes the list through unchanged.
JSON output: gittensor/cli/issue_commands/submissions.py always sets 'success': True when no exception is raised.
Tests encode current behavior: tests/utils/test_github_api_tools.py expects [] when GraphQL raises — no coverage for None meaning failure.
Suggested fix
Stop coercing None to [] in find_prs_for_issue (one-line change), then handle None in fetch_open_issue_pull_requests / --json mode with an explicit error payload (same pattern as #1357 / #1358 for gitt issues list).
Impact
- Bounty submitters/operators may believe nobody has submitted when GitHub lookup actually failed.
- Monitoring/automation on
--json output gets false negatives.
Environment
Description
When GitHub GraphQL cross-reference lookup fails,
_search_issue_referencing_prs_graphqlcorrectly returnsNone(rate limit, network error, GraphQL errors, missing issue payload). The public wrapperfind_prs_for_issuecollapses that failure sentinel to an empty list viareturn prs or [].Downstream,
gitt issues submissions --jsonthen emits a successful response with"submission_count": 0— indistinguishable from a genuinely empty submission list.This is inconsistent with other paths in the same module that preserve
Nonefor retry/failure signaling, e.g.find_solver_from_closure_eventandcheck_github_issue_closed(solver_lookup_failed=True).Steps to Reproduce
GITTENSOR_MINER_PATto a valid token.gitt issues submissions --id <active_issue_id> --jsonfor an issue that has open referencing PRs on GitHub._search_issue_referencing_prs_graphqlreturningNone).Actual: JSON like:
{"success": true, "submission_count": 0, "submissions": []}Expected: Lookup failure should be distinguishable from “no submissions exist” — error / retry guidance, not false success.
Affected code
Failure sentinel (correct):
gittensor/utils/github_api_tools.py~272–284 —_search_issue_referencing_prs_graphqlreturnsNoneon GraphQL failure.Collapse bug:
gittensor/utils/github_api_tools.py~337:CLI consumer:
gittensor/cli/issue_commands/helpers.pyfetch_open_issue_pull_requestspasses the list through unchanged.JSON output:
gittensor/cli/issue_commands/submissions.pyalways sets'success': Truewhen no exception is raised.Tests encode current behavior:
tests/utils/test_github_api_tools.pyexpects[]when GraphQL raises — no coverage forNonemeaning failure.Suggested fix
Stop coercing
Noneto[]infind_prs_for_issue(one-line change), then handleNoneinfetch_open_issue_pull_requests/--jsonmode with an explicit error payload (same pattern as #1357 / #1358 forgitt issues list).Impact
--jsonoutput gets false negatives.Environment
testAttributeErrorcrash)