fix(sync-nlb-checker): fall through to HTTPS when gh is not on PATH - #2933
Conversation
`_fetch` ran `gh api` through `subprocess.run` and read its exit status to decide whether to try raw HTTPS, but a machine with no `gh` on PATH never gets an exit status: `subprocess.run` raises `FileNotFoundError`, and it escaped `_fetch` instead of reaching the documented HTTPS route. The `OSError` is caught, its text kept as the gh-side reason, and HTTPS runs as it does for any other gh failure; when both routes fail the error still names both. A stub-based suite pins the missing-gh fall-through, the working-gh short circuit, the failing-gh fall-through, and the both-fail message, and is wired into validate.yml. Closes #2338 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VJ5YLpnoipBafisrTZkCCt
|
Claude finished review — View run SummaryPR #2933 fixes issue #2338: Verification performed
Notes (non-blocking)
No CLAUDE.md violations, no bugs, no hallucinated APIs (uses only stdlib VerdictReady for merge Structured Review Data (JSON){
"schema_version": "1.0",
"reviewer": "claude",
"commit_sha": "c0375bfa59a928f5b49885fdcdfe50f1ebdc718d",
"verdict": "CLEAN",
"findings": []
}Reviewed commit: c0375bf |
Closes #2338
_fetchinscripts/sync-nlb-checker.pyrangh apithroughsubprocess.runand read the exit status to decide whether to try raw HTTPS, but a machine with noghon PATH never gets an exit status:subprocess.runraisesFileNotFoundError, which escaped_fetchinstead of reaching the documented HTTPS route (the non-blocking finding deferred from #2322's review).What changed
OSErroris caught, its text kept as the gh-side reason, and the HTTPS route runs exactly as it does for any otherghfailure; when both routes fail theSystemExitstill names both.scripts/test_sync_nlb_checker.py, offline with both routes stubbed: missingghfalls through to HTTPS; a workingghnever consults HTTPS; a failingghfalls through; and both both-fail cases name the gh reason and the HTTPS error. Registered invalidate.yml(check-test-suites-covered.py: 55 of 55 gated).Validation
The new suite,
scripts/test_slb.py(104 cases),check-ascii-punctuation.py, andcheck-test-suites-covered.pypass at the pushed head. Against the pre-fix script, a stubbed missingghraisesFileNotFoundErrorout of_fetch(the defect reproduces).No adversarial self-review subagent ran before this push (the auto-mode classifier denies dispatches from this session), so the bot review is the first independent read.
🤖 Generated with Claude Code
https://claude.ai/code/session_01VJ5YLpnoipBafisrTZkCCt
Generated by Claude Code