Skip to content

Commit 3b4eaf2

Browse files
committed
Consolidate pull request review tools
1 parent dee5927 commit 3b4eaf2

10 files changed

+337
-597
lines changed

README.md

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -779,20 +779,6 @@ The following sets of tools are available (all are on by default):
779779
- `startSide`: For multi-line comments, the starting side of the diff that the comment applies to. LEFT indicates the previous state, RIGHT indicates the new state (string, optional)
780780
- `subjectType`: The level at which the comment is targeted (string, required)
781781

782-
- **create_and_submit_pull_request_review** - Create and submit a pull request review without comments
783-
- `body`: Review comment text (string, required)
784-
- `commitID`: SHA of commit to review (string, optional)
785-
- `event`: Review action to perform (string, required)
786-
- `owner`: Repository owner (string, required)
787-
- `pullNumber`: Pull request number (number, required)
788-
- `repo`: Repository name (string, required)
789-
790-
- **create_pending_pull_request_review** - Create pending pull request review
791-
- `commitID`: SHA of commit to review (string, optional)
792-
- `owner`: Repository owner (string, required)
793-
- `pullNumber`: Pull request number (number, required)
794-
- `repo`: Repository name (string, required)
795-
796782
- **create_pull_request** - Open new pull request
797783
- `base`: Branch to merge into (string, required)
798784
- `body`: PR description (string, optional)
@@ -803,11 +789,6 @@ The following sets of tools are available (all are on by default):
803789
- `repo`: Repository name (string, required)
804790
- `title`: PR title (string, required)
805791

806-
- **delete_pending_pull_request_review** - Delete the requester's latest pending pull request review
807-
- `owner`: Repository owner (string, required)
808-
- `pullNumber`: Pull request number (number, required)
809-
- `repo`: Repository name (string, required)
810-
811792
- **list_pull_requests** - List pull requests
812793
- `base`: Filter by base branch (string, optional)
813794
- `direction`: Sort direction (string, optional)
@@ -843,6 +824,15 @@ Possible options:
843824
- `pullNumber`: Pull request number (number, required)
844825
- `repo`: Repository name (string, required)
845826

827+
- **pull_request_review_write** - Write operations (create, submit, delete) on pull request reviews.
828+
- `body`: Review comment text (string, optional)
829+
- `commitID`: SHA of commit to review (string, optional)
830+
- `event`: Review action to perform. If not specified, pending review is created. (string, optional)
831+
- `method`: The write operation to perform on pull request review. (string, required)
832+
- `owner`: Repository owner (string, required)
833+
- `pullNumber`: Pull request number (number, required)
834+
- `repo`: Repository name (string, required)
835+
846836
- **request_copilot_review** - Request Copilot review
847837
- `owner`: Repository owner (string, required)
848838
- `pullNumber`: Pull request number (number, required)
@@ -857,13 +847,6 @@ Possible options:
857847
- `repo`: Optional repository name. If provided with owner, only pull requests for this repository are listed. (string, optional)
858848
- `sort`: Sort field by number of matches of categories, defaults to best match (string, optional)
859849

860-
- **submit_pending_pull_request_review** - Submit the requester's latest pending pull request review
861-
- `body`: The text of the review comment (string, optional)
862-
- `event`: The event to perform (string, required)
863-
- `owner`: Repository owner (string, required)
864-
- `pullNumber`: Pull request number (number, required)
865-
- `repo`: Repository name (string, required)
866-
867850
- **update_pull_request** - Edit pull request
868851
- `base`: New base branch name (string, optional)
869852
- `body`: New description (string, optional)

internal/githubv4mock/githubv4mock.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func NewMockedHTTPClient(ms ...Matcher) *http.Client {
167167
return
168168
}
169169
defer func() { _ = r.Body.Close() }()
170-
170+
171171
matcher, ok := matchers[gqlRequest.Query]
172172
if !ok {
173173
http.Error(w, fmt.Sprintf("no matcher found for query %s", gqlRequest.Query), http.StatusNotFound)

pkg/github/__toolsnaps__/create_and_submit_pull_request_review.snap

Lines changed: 0 additions & 49 deletions
This file was deleted.

pkg/github/__toolsnaps__/create_pending_pull_request_review.snap

Lines changed: 0 additions & 34 deletions
This file was deleted.

pkg/github/__toolsnaps__/delete_pending_pull_request_review.snap

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"annotations": {
3+
"title": "Write operations (create, submit, delete) on pull request reviews.",
4+
"readOnlyHint": false
5+
},
6+
"description": "Create and/or submit, delete pull request review.\n\nAvailable methods:\n- create: Create a new pull request review. If \"event\" parameter is provided, the review is submitted. If \"event\" is omitted, a pending review is created.\n- submit_pending: Submit an existing pending pull request review. This requires that a pending review exists for the current user on the specified pull request. The \"body\" and \"event\" parameters are used when submitting the review.\n- delete_pending: Delete an existing pending pull request review. This requires that a pending review exists for the current user on the specified pull request.\n",
7+
"inputSchema": {
8+
"properties": {
9+
"body": {
10+
"description": "Review comment text",
11+
"type": "string"
12+
},
13+
"commitID": {
14+
"description": "SHA of commit to review",
15+
"type": "string"
16+
},
17+
"event": {
18+
"description": "Review action to perform. If not specified, pending review is created.",
19+
"enum": [
20+
"APPROVE",
21+
"REQUEST_CHANGES",
22+
"COMMENT"
23+
],
24+
"type": "string"
25+
},
26+
"method": {
27+
"description": "The write operation to perform on pull request review.",
28+
"type": "string"
29+
},
30+
"owner": {
31+
"description": "Repository owner",
32+
"type": "string"
33+
},
34+
"pullNumber": {
35+
"description": "Pull request number",
36+
"type": "number"
37+
},
38+
"repo": {
39+
"description": "Repository name",
40+
"type": "string"
41+
}
42+
},
43+
"required": [
44+
"method",
45+
"owner",
46+
"repo",
47+
"pullNumber"
48+
],
49+
"type": "object"
50+
},
51+
"name": "pull_request_review_write"
52+
}

pkg/github/__toolsnaps__/submit_pending_pull_request_review.snap

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)