CLAUDE.md: the CI-check recipe was wrong in two ways, both measured today
gates / gates (push) Successful in 24s
gates / gates (push) Successful in 24s
1. The response key is `jobs`, not `workflow_runs`. A parser reading the latter gets an empty list and prints nothing, which reads exactly like "no CI run for this commit". That is R-417's own shape — a field the API never populates — committed while following the instructions R-417 wrote. 2. Job ids are not ordered within a page, so page = total/50 + 1 does not hold the newest rows. Scan every page and match on head_sha. Guessing the page produced three consecutive false "no CI job" readings in one session before the raw response was finally looked at. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -161,8 +161,18 @@ something, not only sessions that touch `documentation/` — which is why it is
|
||||
|
||||
```bash
|
||||
T=$(curl -s -u "$U:$P" ".../actions/jobs?limit=1" | python3 -c 'import json,sys;print(json.load(sys.stdin)["total_count"])')
|
||||
curl -s -u "$U:$P" ".../actions/jobs?limit=50&page=$(( T/50 + 1 ))" # then grep your own head_sha
|
||||
for pg in $(seq 1 $(( (T+49)/50 ))); do curl -s -u "$U:$P" ".../actions/jobs?limit=50&page=$pg"; done
|
||||
# then match your own head_sha across ALL of them
|
||||
```
|
||||
|
||||
**Two things this recipe got wrong until 2026-09-20, both measured the hard way:**
|
||||
1. **The response key is `jobs`, not `workflow_runs`.** A parser reading `workflow_runs` gets an
|
||||
empty list and prints nothing — which reads exactly like "no CI run for this commit" and is not.
|
||||
That is R-417's own shape (a field the API never populates) committed while checking R-417.
|
||||
2. **Job ids are NOT ordered within a page**, so `page = total/50 + 1` does not hold the newest
|
||||
rows — a run can sit several pages earlier. **Scan every page** and match on `head_sha`; with a
|
||||
few hundred jobs that is a handful of requests. Guessing the page produced three consecutive
|
||||
false "no CI job for this commit" readings in one session.
|
||||
|
||||
An unchecked green is an assumption, not an observation — and so is a green read off a field the
|
||||
API never populates.
|
||||
|
||||
Reference in New Issue
Block a user