You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add granular tools to hide and unhide issue comments, PR review comments and PR reviews (#3350)
* Add hide_comment and unhide_comment granular issue tools
Add two tools behind the issues_granular feature flag that hide
(minimize) and unhide (unminimize) comments via the GraphQL
minimizeComment/unminimizeComment mutations.
They support issue and pull request conversation comments, pull
request review comments, and pull request review bodies. Callers
pass the numeric REST ID plus a comment_type; the tool resolves the
GraphQL node ID via the matching REST endpoint before mutating.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Rename comment_type enum values to pull_request_review(_comment)
Use `pull_request_review` and `pull_request_review_comment` instead of
`review` and `review_comment` so the comment_type values are explicit
about which object they refer to.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Use realistic minimizedReason values in hide_comment test mocks
GitHub returns minimizedReason in lowercase, hyphenated form (e.g.
"off-topic") rather than echoing the classifier enum, as confirmed by
an end-to-end run against the live API.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Split hide/unhide comment tools per object type
Replace hide_comment/unhide_comment, which took a comment_type
argument, with a granular pair per object type:
- hide_issue_comment / unhide_issue_comment (issues_granular):
issue comments and pull request conversation comments
- hide_pull_request_review_comment / unhide_pull_request_review_comment
(pull_requests_granular): inline pull request review comments
- hide_pull_request_review / unhide_pull_request_review
(pull_requests_granular): pull request review bodies
Every argument is now unconditionally required, so the schemas no
longer need prose explaining which arguments apply to which type. The
six tools are built from one shared helper, parameterised by a
commentVisibilityTarget that describes each object type and how to
resolve its GraphQL node ID.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Validate classifier and IDs before calling the GitHub API
JSON schema constraints (enum, minimum) aren't enforced when tool
arguments are unmarshalled, so an invalid classifier or a negative ID
previously reached GitHub and surfaced as a confusing 404 or GraphQL
error. Reject them up front with a clear argument error instead.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
-`classifier`: The reason for hiding the comment (string, required)
278
+
-`comment_id`: The numeric pull request review comment ID. Use the number from a #discussion_r... anchor, not the GraphQL thread node ID (PRRT_...). (number, required)
279
+
-`owner`: Repository owner (username or organization) (string, required)
-`comment_id`: The numeric pull request review comment ID. Use the number from a #discussion_r... anchor, not the GraphQL thread node ID (PRRT_...). (number, required)
@@ -277,6 +305,19 @@ as output formatting) won't appear here.
277
305
-`pullNumber`: The pull request number (number, required)
-`comment_id`: The numeric pull request review comment ID. Use the number from a #discussion_r... anchor, not the GraphQL thread node ID (PRRT_...). (number, required)
318
+
-`owner`: Repository owner (username or organization) (string, required)
"description": "Hide (minimize) a comment on an issue, or a conversation comment on a pull request. Requires triage or write access to the repository, or being its author.",
10
+
"inputSchema": {
11
+
"properties": {
12
+
"classifier": {
13
+
"description": "The reason for hiding the comment",
14
+
"enum": [
15
+
"SPAM",
16
+
"ABUSE",
17
+
"OFF_TOPIC",
18
+
"OUTDATED",
19
+
"DUPLICATE",
20
+
"RESOLVED",
21
+
"LOW_QUALITY"
22
+
],
23
+
"type": "string"
24
+
},
25
+
"comment_id": {
26
+
"description": "The numeric ID of the issue or pull request conversation comment",
27
+
"minimum": 1,
28
+
"type": "number"
29
+
},
30
+
"owner": {
31
+
"description": "Repository owner (username or organization)",
"description": "Hide (minimize) an inline review comment on a pull request diff. Requires triage or write access to the repository, or being its author.",
10
+
"inputSchema": {
11
+
"properties": {
12
+
"classifier": {
13
+
"description": "The reason for hiding the comment",
14
+
"enum": [
15
+
"SPAM",
16
+
"ABUSE",
17
+
"OFF_TOPIC",
18
+
"OUTDATED",
19
+
"DUPLICATE",
20
+
"RESOLVED",
21
+
"LOW_QUALITY"
22
+
],
23
+
"type": "string"
24
+
},
25
+
"comment_id": {
26
+
"description": "The numeric pull request review comment ID. Use the number from a #discussion_r... anchor, not the GraphQL thread node ID (PRRT_...).",
27
+
"minimum": 1,
28
+
"type": "number"
29
+
},
30
+
"owner": {
31
+
"description": "Repository owner (username or organization)",
"description": "Unhide (unminimize) a previously hidden comment on an issue, or conversation comment on a pull request. Requires triage or write access to the repository, or being its author.",
10
+
"inputSchema": {
11
+
"properties": {
12
+
"comment_id": {
13
+
"description": "The numeric ID of the issue or pull request conversation comment",
14
+
"minimum": 1,
15
+
"type": "number"
16
+
},
17
+
"owner": {
18
+
"description": "Repository owner (username or organization)",
"description": "Unhide (unminimize) the previously hidden body of a submitted pull request review. Requires triage or write access to the repository, or being its author.",
10
+
"inputSchema": {
11
+
"properties": {
12
+
"owner": {
13
+
"description": "Repository owner (username or organization)",
14
+
"type": "string"
15
+
},
16
+
"pullNumber": {
17
+
"description": "The pull request number",
18
+
"minimum": 1,
19
+
"type": "number"
20
+
},
21
+
"repo": {
22
+
"description": "Repository name",
23
+
"type": "string"
24
+
},
25
+
"review_id": {
26
+
"description": "The numeric ID of the pull request review",
"description": "Unhide (unminimize) a previously hidden inline review comment on a pull request diff. Requires triage or write access to the repository, or being its author.",
10
+
"inputSchema": {
11
+
"properties": {
12
+
"comment_id": {
13
+
"description": "The numeric pull request review comment ID. Use the number from a #discussion_r... anchor, not the GraphQL thread node ID (PRRT_...).",
14
+
"minimum": 1,
15
+
"type": "number"
16
+
},
17
+
"owner": {
18
+
"description": "Repository owner (username or organization)",
0 commit comments