Repository navigation
Conversation
The review failure toast ignored PullRequestOperationError.detail, which already carries GitHub's refusal. Show it, as the label and reviewer pickers do.
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused web bug fix that surfaces an existing host refusal reason in the review-submission error toast while preserving the draft and all submission behavior. It changes one failure-message path, uses existing tested helpers, and introduces no schema, default, security, or deployment changes. You can add or adjust custom eligibility rules. Learn more. |
Contributor
2 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When GitHub refuses a pull request review, the web client shows only "The review could not be submitted", so the reviewer cannot tell what to fix (#12549). GitHub's reason already reaches the client:
submitReviewposts through the REST client, whose errors carry GitHub'smessageanderrors[]since #19224, and that text arrives asPullRequestOperationError.detail. The toast inPullRequestReviewForm.tsxnever reads it. The mobile review sheet already shows the failure's message.Change
The failure toast gets a description from
readableFailure(squashAtomCommandFailure(result), hint), the same call the label and reviewer pickers use for their refusals. It drops the "Pull request operation … failed:" prefix, falls back to the hint when the host gives nothing readable, and caps the text at 320 characters. The title, the kept draft and the success path are unchanged. Web only: the server already sends the reason.Scope and approval
Refs #12549. This is item 3 of Julius's triage: "Surface GitHub’s 422. If something still slips through, … show that string in the toast.
PullRequestOperationErroralready has adetailfield; the UI just does not use it here." Item 1, refusing anchors outside the hunks, landed in #12583.It picks up agomesp's #13293, which was closed for missing before/after screenshots of this toast and the kept draft. Its server half, carrying the
gh apierror body intodetail, is no longer needed after #19224.Verification
vp lintandvp fmt --checkon the file and the@t3tools/webtypecheck are clean.pullRequestDetail.logic.test.ts, which coversreadableFailure, passes (140 tests). No new test: the change passes an existing, tested helper's output to the toast.Real app: the dev desktop app from this branch on an empty
.t3, signed in throughgh, against a throwaway pull request in a private scratch repository. I drafted a line comment onsrc/greeting.ts:10, pushed a commit that tooksrc/greeting.tsout of the pull request, and submitted the review with that comment still pending. GitHub refused it each time, and the summary and the pending comment ("Review (1)") stayed.Before (
main'sPullRequestReviewForm.tsx, same session and draft):This branch, where the toast adds GitHub's reason, "GitHub returned an error: Unprocessable Entity; Path could not be resolved":
After discarding the stale comment, the same review went through: "Review submitted", the summary cleared, and GitHub lists the review.
Not checked: GitHub's
Line could not be resolvedfrom the issue, since fix(web): keep review comments inside the pull request's hunks #12583 now refuses that anchor before a comment exists; other hosts (GitLab, Bitbucket, Azure DevOps), whose providers filldetailin their own words; mobile, unchanged.Claude Opus 5.5 via T3 Code