Repository navigation
fix(ci): report why a pr-unblock select job could not read the pull request - #13117
Conversation
…request The Read the PR head step swallowed a failed `gh api` with `|| true`, so any read failure reported "the PR names no head SHA". Run 41775375216 (#13027) failed that way on `invalid character 'b' looking for beginning of value`, a non-JSON body from the API that the step never showed. The step now keeps the read's stderr and fails with its text and class: transient (5xx, timeout, connection error, non-JSON body), rate-limit (the api-budget wrapper's refusal included) or other. A transient failure is read once more after 5 to 10 s; a rate limit and any other failure are not read again. A read that succeeds with no head SHA still reports as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…equest The same swallowed `gh api` read (`|| true`, then "the PR names no head SHA") sat in four steps: resolve-conflicts-select, sync-shared-copies-select, address-feedback-select and review-dependency-select. Each already checks out the default branch tip at `.base`, so the read, its failure classes and its one transient retry move to `.github/scripts/pr-unblock/read-pr-head.bash` (`read_pr_fields`), sourced from `.base` in all four. The file joins the enforcement hold floor like the other scripts those jobs run with a token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
api-budget-coverage.test.mjs treats a script path named in ci-status's hold_patterns as a script that step runs, and the helper's gh call is wrapped by its sourcing step, not by itself. Drop the hold-floor rows added for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
claude-security-review reviewed Security review (incremental since 51c4fa4): no security issues foundI read the whole incremental change. It touches one file, What changed: the What I checked:
critical-findings: 0 |
|
claude-review reviewed Code review (incremental, since 51c4fa4): PR #13117No findings. I read the one hunk this push changed, in What I checked
I did not run the tests. That the suite passes is the author's claim and I have not checked it. Other notes
|
resolve-conflicts-select's head step now sources read-pr-head.bash from the default-branch checkout at .base, and the callers test ran the step in a directory with none. Run it in a work directory whose .base links to the repository root, the layout the job's checkout gives it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No related issue: hub ledger item for pr-unblock (06:3xZ); a select job swallowed its pull-request read and reported "the PR names no head SHA" (#13027, run 41775375216).
Summary
Four pr-unblock select jobs read the pull request with
|| true, so a failed read surfaced only as "the PR names no head SHA". On #13027 (run 41775375216, job 126394422464, 04:48Z) the read actually failed withinvalid character 'b' looking for beginning of value, a non-JSON body, not a missing SHA and not a rate-limit refusal.Fix
.github/scripts/pr-unblock/read-pr-head.bash,read_pr_fields <number> <jq fields>: reads the pull request and classifies a failure. It reads at most twice:api_budget_stop_until coreset): never retried.invalid character,unexpected end of JSON input, connection or timeout): read once more after 5-10 s.::error::the PR could not be read (<class>): <text>, single-line, capped at 300 characters,%escaped.pr-unblock.yml: resolve-conflicts-select, sync-shared-copies-select, address-feedback-select and review-dependency-select source the helper from.base(the default-branch tip each already checks out, never head code) after their unchangedapi_budget_wrap_ghline. A read that succeeds with no SHA still reports "the PR names no head SHA"; exit codes are unchanged.Verification
workflow-gates.test.mjs: 54/54. It includes a classification test of the sourced helper with a stubghandsleepcovering:A parameterized test also checks that all four steps source the helper from
.base.api-budget-coverage.test.mjs5/5;merge-holds.test.mjs65/65.scripts/check-affected.sh --base origin/main --no-fetch: exit 0.Left out: the cause of the non-JSON body (no HTTP status in the log); the transient retry covers it.
Related
🤖 Generated with Claude Code