shuke987 opened a new pull request, #69386:
URL: https://github.com/apache/doris/pull/69386
### What problem does this PR solve?
Issue Number: N/A
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.
### Release note
None
### Check List (For Author)
- Test
- [x] Unit Test: Python workflow/helper suite completed 256 tests, OK
with 19 Linux-only tests/subtests skipped on macOS. The submission suite passed
all 37 tests after the final formatting adjustment.
- [x] Manual test: Real gh 2.88.1 against a loopback HTTP server with
fake credentials preserved normal 201 output and captured status/request ID for
empty JSON 422, 502, and 503 errors. Four calls produced exactly four POST
requests.
- [x] Workflow validation: actionlint v1.7.7 passed with only the
existing unsupported `concurrency.queue` syntax ignored; optional
ShellCheck/Pyflakes disabled. Workflow equivalence checks and `git diff
--check` passed.
Full suite command:
```sh
RUN_GH_HTTP_TESTS=1 PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover
-s .github/scripts -p 'test_*.py' -v
```
- Behavior changed:
- [x] Yes. Adds trusted diagnostic bootstrap and failure artifacts;
existing review decisions and API retry/posting policy remain unchanged.
- Does this need documentation?
- [x] Yes. Included `.github/scripts/review-github-diagnostics.md`.
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]