feat(review): post file-scoped comments as GitHub file-level review threads (#1599) (#1600)
* feat(review): post file-scoped comments as GitHub file-level review threads (#1599)
On GitHub, a file-scoped annotation now posts as a file-level thread
(addPullRequestReviewThread, subjectType FILE) inside the same review
instead of a **path:** paragraph in the review body. The review is
created pending with the line comments, the file threads are attached,
then it is submitted with the event and body.
Fallbacks keep every comment: a thread GitHub rejects is folded into the
submitted body; if the pending review cannot be created the old single
call runs with the comments in the body; a failed submit discards the
pending review. GitLab, general comments, line and outdated comments are
unchanged. Bun and Pi servers forward the new field identically.
* fix(review): harden GitHub file-level review submit edge cases (#1599)
- An unreadable pending-review reply now tells the user a pending review
may remain and to submit or discard it on GitHub.
- A COMMENT with an empty body gets the placeholder body server-side, so
an API caller cannot strand a pending review in a 422.
- A failed submit first reads the review; if GitHub already shows it
submitted, report success instead of deleting it.
- Only log the body fallback once the fallback call actually succeeded.
* fix(review): show GitHub's reason when it refuses a review (#1599)
gh prints only the generic status line ("Unprocessable Entity (HTTP
422)") on stderr; GitHub's reason lives in the JSON body on stdout.
Read it from REST errors[] (strings or { message }) and GraphQL
errors[].message, falling back to the top-level message, and append it
to the error for both the single-call and pending-review paths. Capped
at 300 characters; a JSON body is never shown verbatim. M
Michael Ramos committed
618172c8bb7d40c1bd9393a61e08e60d7fd7fdbb
Parent: dd34051
Committed by GitHub <noreply@github.com>
on 9/23/2026, 5:49:43 PM