mirror of
https://github.com/apache/doris.git
synced 2026-11-04 07:31:17 +00:00
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.