You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python CI gate: gh pr checks --json ...,headSha always fails ("Unknown JSON field"), so every watch returns status="error" #159
gh pr checks --json has no headSha field. gh rejects the whole call with no JSON on stdout, so _parse_checks gets nothing and the watcher returns status="error" on the first poll. _run_ci_gate treats error as terminal, so the CI gate never watches checks and run_ci_fixer is never reached, even when no head_sha is passed (fresh build() PRs).
The Go port already fixed this. go/internal/cigate/watch.go requests only bucket,state,name,workflow,link and explains that requesting headSha "previously turned every watch into status="error"". The Python path still has the old field list.
Reproduction
gh 2.100.0 (2026-09-03), on any PR with checks:
$ gh pr checks 10 --json bucket,state,name,workflow,link,headShaUnknown JSON field: "headSha"Available fields: bucket completedAt description event link name startedAt state workflow
$ gh pr checks 10 --json bucket,state,name,workflow,link[{"bucket":"pass","name":"check_docs","state":"SUCCESS","workflow":"CI", ...}, ...]
Watcher result recorded by a real build() run (Python node, main at 4d1f11c):
The build still reports succeeded, so a driver that merges successful builds can merge PRs whose CI is red, without anyone noticing.
Suggested fix
Mirror the Go port: use fields = "bucket,state,name,workflow,link". The existing "no check carries a headSha" fallback then gives PR-level verdicts, as intended.
If per-commit anchoring for resolve() is still wanted, one option is comparing gh pr view <n> --json headRefOid with the expected SHA before accepting a verdict. gh pr checks itself can't provide it.
A unit test where the fake runner rejects unknown --json fields, as real gh does, would catch a regression.
Activity