1 Commits
Author SHA1 Message Date
shuke a2638f38ea [fix](build) Preserve GitHub API failure diagnostics for code review (#69386)
Problem Summary:

An empty or malformed JSON error response can make `gh api` fail with
only `unexpected end of JSON input`, hiding the HTTP status and GitHub
request ID. This prevents distinguishing transient server failures from
rejected requests in the review pipeline.

Add a shared diagnostic helper for review startup, status
synchronization and aggregation, helper downloads, submission, and head
polling. Each failure records HTTP status, allowlisted response headers,
bounded redacted response/output excerpts, exit code or timeout, and run
context. Failure artifacts are uploaded even before PR checkout or when
the caller handles the error. Load the helper from the immutable
workflow commit before the first API request; distinguish aggregate
artifacts by head SHA.

Outgoing request headers, bodies, and complete command arguments are
excluded. Credential values and fields are redacted before truncation.
Response excerpts depend on gh's debug format and are not complete wire
captures.

Normal stdout, existing request arguments, permissions, review verdicts,
submission deduplication, and retry behavior are preserved.
2026-10-22 10:44:22 +08:00