Skip to content

fix: clarify pending review creation - #2569

Open
he-yufeng wants to merge 2 commits into
github:mainfrom
he-yufeng:fix/pending-review-tool-copy
Open

he-yufeng wants to merge 2 commits into
github:mainfrom
he-yufeng:fix/pending-review-tool-copy

Conversation

@he-yufeng

Copy link
Copy Markdown
Contributor

Summary

  • make the pull_request_review_write title say that create opens a pending review
  • clarify that method: "create" without event does not submit the review
  • update the tool snapshot and README tool list

Fixes #2524.

To verify

  • UPDATE_TOOLSNAPS=true go test ./pkg/github -run TestCreateAndSubmitPullRequestReview -count=1
  • go test ./pkg/github -run TestCreateAndSubmitPullRequestReview -count=1
  • go test ./pkg/github -count=1
  • go test ./...
  • git diff --check

@he-yufeng
he-yufeng requested a review from a team as a code owner May 29, 2026 09:02
@he-yufeng
he-yufeng force-pushed the fix/pending-review-tool-copy branch from 1f952ed to 5a97566 Compare May 29, 2026 11:05
@he-yufeng

Copy link
Copy Markdown
Contributor Author

Rebased the branch onto current origin/main and force-pushed 5a97566.

Validation after rebase:

  • go test ./...

SamMorrowDrums
SamMorrowDrums previously approved these changes May 30, 2026

@SamMorrowDrums SamMorrowDrums left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Targeted fix for #2524 — makes it clear that create without event produces a pending review, and refreshes the description to cover all five methods (including resolve_thread/unresolve_thread). README and toolsnap are updated consistently.

Minor nit: the user-facing Title annotation still doesn't mention thread resolve/unresolve, while the description does. Could broaden in a follow-up (e.g. "Manage pull request reviews and review threads"), not blocking. LGTM.

@he-yufeng
he-yufeng force-pushed the fix/pending-review-tool-copy branch from 133347f to cc3f9b9 Compare June 4, 2026 03:51
@he-yufeng

Copy link
Copy Markdown
Contributor Author

Rebased this approved branch onto current origin/main and force-pushed cc3f9b9.

Validation after rebase:

  • go test ./...
  • git diff --check origin/main..HEAD

The PR diff remains limited to README.md, pkg/github/pullrequests.go, and the pull request review toolsnap.

@he-yufeng
he-yufeng force-pushed the fix/pending-review-tool-copy branch from cc3f9b9 to 1101a48 Compare June 4, 2026 20:37
@he-yufeng

Copy link
Copy Markdown
Contributor Author

Rebased this approved branch onto latest github:main again and force-pushed 1101a48.

Validation after rebase:

go test ./... -count=1
# ok

git diff --check origin/main..HEAD
# passed

@he-yufeng
he-yufeng force-pushed the fix/pending-review-tool-copy branch from 1101a48 to 5cb469b Compare June 6, 2026 18:00
@he-yufeng

Copy link
Copy Markdown
Contributor Author

Rebased this approved branch onto current origin/main and force-pushed 5cb469b.

Validation after rebase:

go test ./...
# ok

git diff --check origin/main..HEAD
# passed

@he-yufeng
he-yufeng force-pushed the fix/pending-review-tool-copy branch 2 times, most recently from a988a47 to 6ab4dad Compare June 16, 2026 08:57
@he-yufeng
he-yufeng force-pushed the fix/pending-review-tool-copy branch from 6ab4dad to b2bf8bb Compare June 20, 2026 02:12
@he-yufeng

Copy link
Copy Markdown
Contributor Author

Friendly nudge: this has been approved since May 30 and I've kept the branch current with main since. Happy to adjust anything if the review picture has changed.

@he-yufeng

Copy link
Copy Markdown
Contributor Author

Is anything blocking this from merge? Happy to rebase or adjust the wording if the pending-review flow has changed since the approval in May.

@he-yufeng

Copy link
Copy Markdown
Contributor Author

Rebased onto current main and resolved the conflicts from the typed-inputs migration (#3396): kept the new OutputSchema wiring and the regenerated variant snap, with the pending-review wording intact on both the tool and its resolution_reason variant.

go test ./pkg/github/ passes locally (11s), including the toolsnaps schema checks. This should be mergeable again for whenever a maintainer has a moment.

Upstream github#3727 removed the thread_resolution_reason feature flag and deleted
pkg/github/__toolsnaps__/pull_request_review_write_resolution_reason.snap,
because resolution reasons are now always available outside GHES. This branch
still carried a wording edit to that snapshot, which produced a modify/delete
conflict.

Accept the deletion. The variant it described no longer exists, so the wording
fix belongs only in the surviving pull_request_review_write tool and snapshot.
The pending-review clarification is unchanged there.

Test Plan:

```sh
go test ./pkg/github/ -run 'TestCreateAndSubmitPullRequestReview|TestCreatePendingPullRequestReview|TestSubmitPendingPullRequestReview|TestDeletePendingPullRequestReview|TestResolveReviewThread|TestUnresolveReviewThread' -count=1
go vet ./pkg/github/
gofmt -l pkg/github/pullrequests.go
```

5 top-level tests and 23 subtests pass, including the toolsnaps comparison for
the surviving snapshot. go vet is clean and gofmt reports no diff. Net diff
against current main is 3 files, 6 insertions, 6 deletions: the tool description
and title, the matching snapshot, and the README tool table row.

Signed-off-by: Yufeng He <40085740+he-yufeng@users.noreply.github.com>
Copilot AI adaptive review requested due to automatic review settings November 19, 2026 04:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active issues are identified, and the documentation, tool metadata, and snapshot consistently clarify pending versus submitted review creation behavior.

No open issues 🎉

What changed in this PR

Clarifies the pull_request_review_write tool's review-creation behavior, including that omitting event creates an unsubmitted pending review while preserving submission when an event is provided.

Changes:

  • Updates the tool title and description.
  • Refreshes the tool metadata snapshot.
  • Updates the README tool listing.
File Description
README.md Updates the documented tool title to clarify pending review creation.
pkg/​github/​pullrequests.go Updates the review-write tool metadata and description to clarify its creation behavior.
pkg/​github/​__toolsnaps__/​pull_request_review_write.snap Records the updated review-write tool metadata and description.

Review effort: Lite (adaptive)

@he-yufeng

Copy link
Copy Markdown
Contributor Author

@cagesellchen @SamMorrowDrums Requesting review. This is a small wording fix that was conflict-blocked, and the conflict came from your #3727, so you're the right people to confirm the resolution.

New head 5d4b3c6e889ec345ee5e375f26c1999806733f9c, merging current main (df32d7ec5786e0e71932767fce9982409cbaec40).

What the PR does: clarifies that pull_request_review_write with method=create and no event creates a review that is not submitted. The old description said "a pending review is created" without stating that it stays pending, and the title listed only "create, submit, delete" while the tool also resolves and unresolves threads. Three lines change: the tool description, its title, and the matching snapshot, plus the README tool-table row.

The conflict and how I resolved it: #3727 removed the thread_resolution_reason feature flag and deleted pull_request_review_write_resolution_reason.snap. This branch still had a wording edit to that snapshot, giving a modify/delete conflict. I accepted the deletion, since the variant it described no longer exists, and kept the clarification only in the surviving tool and snapshot.

Verified on the merged tree:

go test ./pkg/github/ -run 'TestCreateAndSubmitPullRequestReview|TestCreatePendingPullRequestReview|TestSubmitPendingPullRequestReview|TestDeletePendingPullRequestReview|TestResolveReviewThread|TestUnresolveReviewThread' -count=1
go vet ./pkg/github/
gofmt -l pkg/github/pullrequests.go

5 top-level tests and 23 subtests pass, including the toolsnaps comparison against the surviving snapshot. go vet is clean, gofmt reports no diff. Net diff against current main is 3 files, 6 insertions, 6 deletions. I did not run the full repository suite or the GHES-specific legs; CI is the authority for those.

One thing worth your confirmation: with the flag gone, resolution reasons are always available outside GHES, so the single description now covers both cases. If you'd rather the description explicitly mention that GHES omits resolutionReason, say so and I'll add that sentence rather than leaving it implicit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify that pull_request_review_write create without event creates a pending review

3 participants