2 Commits
Author SHA1 Message Date
shuke cb41339ffd [fix](ci) Retry transient review GET failures within bounded budgets (#69510)
Related PR: #69469

Problem Summary: A single transient GitHub response currently aborts the
review pipeline. [Input resolution for
#69322](https://github.com/apache/doris/actions/runs/39794013905/job/119876748768)
stopped on a GET 503 despite `Retry-After: 2`; [aggregate resolution for
#69438](https://github.com/apache/doris/actions/runs/39760934956/job/119764632659)
stopped on a paginated GET 504 after emitting partial output.

The shared helper now retries recognized body-free REST GETs on
502/503/504, for at most three attempts. Each attempt has a 30-second
limit; attempts and waits share a 90-second budget or the caller's
shorter timeout. It respects Retry-After, records every failed attempt,
discards failed pagination output, and returns only a successful
attempt's complete output. Exhaustion still fails. Writes, GraphQL,
unknown argument forms, other HTTP errors, transport/timeouts and JSON
parsing errors are not retried.

Input resolution can also fail before publishing its PR-number output.
Failure notices now fall back to the authorized trigger's numeric PR
identity, explicitly select the repository, and name the
input-resolution failure in both the notice and terminal error. This
fallback does not permit status publication for an unresolved head/base.

This change can merge independently. It includes the same explicit
`--repo` argument as #69469; a local combination with #69469 and #69504
merged cleanly and passed the macOS suite.
2026-11-02 14:23:14 +08:00
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