Skip to content

Commit 7fff6f2

Browse files
Align granular reaction tool constructors
Rename the standalone reaction tool constructors to match the granular tool naming convention and clarify issue comment reaction IDs for pull request comments. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d218ebe commit 7fff6f2

6 files changed

Lines changed: 21 additions & 21 deletions

File tree

docs/feature-flags.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ runtime behavior (such as output formatting) won't appear here.
100100

101101
- **add_issue_comment_reaction** - Add Reaction to Issue or Pull Request Comment
102102
- **Required OAuth Scopes**: `repo`
103-
- `comment_id`: The issue comment ID (number, required)
103+
- `comment_id`: The issue or pull request comment ID (number, required)
104104
- `content`: The emoji reaction type (string, required)
105105
- `owner`: Repository owner (username or organization) (string, required)
106106
- `repo`: Repository name (string, required)

pkg/github/__toolsnaps__/add_issue_comment_reaction.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"inputSchema": {
99
"properties": {
1010
"comment_id": {
11-
"description": "The issue comment ID",
11+
"description": "The issue or pull request comment ID",
1212
"minimum": 1,
1313
"type": "number"
1414
},

pkg/github/granular_tools_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ func TestGranularToolSnaps(t *testing.T) {
4444
GranularRemoveSubIssue,
4545
GranularReprioritizeSubIssue,
4646
GranularSetIssueFields,
47-
AddIssueReaction,
48-
AddIssueCommentReaction,
47+
GranularAddIssueReaction,
48+
GranularAddIssueCommentReaction,
4949
GranularUpdatePullRequestTitle,
5050
GranularUpdatePullRequestBody,
5151
GranularUpdatePullRequestState,
@@ -57,7 +57,7 @@ func TestGranularToolSnaps(t *testing.T) {
5757
GranularAddPullRequestReviewComment,
5858
GranularResolveReviewThread,
5959
GranularUnresolveReviewThread,
60-
AddPullRequestReviewCommentReaction,
60+
GranularAddPullRequestReviewCommentReaction,
6161
}
6262

6363
for _, constructor := range toolConstructors {
@@ -2035,7 +2035,7 @@ func TestGranularSetIssueFields(t *testing.T) {
20352035

20362036
// --- Reaction granular tool handler tests ---
20372037

2038-
func TestAddIssueReaction(t *testing.T) {
2038+
func TestGranularAddIssueReaction(t *testing.T) {
20392039
mockReaction := &gogithub.Reaction{
20402040
ID: gogithub.Ptr(int64(12345)),
20412041
Content: gogithub.Ptr("+1"),
@@ -2086,7 +2086,7 @@ func TestAddIssueReaction(t *testing.T) {
20862086
t.Run(tc.name, func(t *testing.T) {
20872087
client := mustNewGHClient(t, tc.mockedClient)
20882088
deps := BaseDeps{Client: client}
2089-
serverTool := AddIssueReaction(translations.NullTranslationHelper)
2089+
serverTool := GranularAddIssueReaction(translations.NullTranslationHelper)
20902090
handler := serverTool.Handler(deps)
20912091
request := createMCPRequest(tc.args)
20922092
result, err := handler(ContextWithDeps(context.Background(), deps), &request)
@@ -2105,7 +2105,7 @@ func TestAddIssueReaction(t *testing.T) {
21052105
}
21062106
}
21072107

2108-
func TestAddIssueCommentReaction(t *testing.T) {
2108+
func TestGranularAddIssueCommentReaction(t *testing.T) {
21092109
mockReaction := &gogithub.Reaction{
21102110
ID: gogithub.Ptr(int64(67890)),
21112111
Content: gogithub.Ptr("heart"),
@@ -2146,7 +2146,7 @@ func TestAddIssueCommentReaction(t *testing.T) {
21462146
t.Run(tc.name, func(t *testing.T) {
21472147
client := mustNewGHClient(t, tc.mockedClient)
21482148
deps := BaseDeps{Client: client}
2149-
serverTool := AddIssueCommentReaction(translations.NullTranslationHelper)
2149+
serverTool := GranularAddIssueCommentReaction(translations.NullTranslationHelper)
21502150
handler := serverTool.Handler(deps)
21512151
request := createMCPRequest(tc.args)
21522152
result, err := handler(ContextWithDeps(context.Background(), deps), &request)
@@ -2165,7 +2165,7 @@ func TestAddIssueCommentReaction(t *testing.T) {
21652165
}
21662166
}
21672167

2168-
func TestAddPullRequestReviewCommentReaction(t *testing.T) {
2168+
func TestGranularAddPullRequestReviewCommentReaction(t *testing.T) {
21692169
mockReaction := &gogithub.Reaction{
21702170
ID: gogithub.Ptr(int64(54321)),
21712171
Content: gogithub.Ptr("rocket"),
@@ -2206,7 +2206,7 @@ func TestAddPullRequestReviewCommentReaction(t *testing.T) {
22062206
t.Run(tc.name, func(t *testing.T) {
22072207
client := mustNewGHClient(t, tc.mockedClient)
22082208
deps := BaseDeps{Client: client}
2209-
serverTool := AddPullRequestReviewCommentReaction(translations.NullTranslationHelper)
2209+
serverTool := GranularAddPullRequestReviewCommentReaction(translations.NullTranslationHelper)
22102210
handler := serverTool.Handler(deps)
22112211
request := createMCPRequest(tc.args)
22122212
result, err := handler(ContextWithDeps(context.Background(), deps), &request)

pkg/github/issues_granular.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,8 +1199,8 @@ func GranularSetIssueFields(t translations.TranslationHelperFunc) inventory.Serv
11991199
return st
12001200
}
12011201

1202-
// AddIssueReaction adds a reaction to an issue or pull request.
1203-
func AddIssueReaction(t translations.TranslationHelperFunc) inventory.ServerTool {
1202+
// GranularAddIssueReaction adds a reaction to an issue or pull request.
1203+
func GranularAddIssueReaction(t translations.TranslationHelperFunc) inventory.ServerTool {
12041204
st := NewTool(
12051205
ToolsetMetadataIssues,
12061206
mcp.Tool{
@@ -1281,8 +1281,8 @@ func AddIssueReaction(t translations.TranslationHelperFunc) inventory.ServerTool
12811281
return st
12821282
}
12831283

1284-
// AddIssueCommentReaction adds a reaction to an issue or pull request comment.
1285-
func AddIssueCommentReaction(t translations.TranslationHelperFunc) inventory.ServerTool {
1284+
// GranularAddIssueCommentReaction adds a reaction to an issue or pull request comment.
1285+
func GranularAddIssueCommentReaction(t translations.TranslationHelperFunc) inventory.ServerTool {
12861286
st := NewTool(
12871287
ToolsetMetadataIssues,
12881288
mcp.Tool{
@@ -1307,7 +1307,7 @@ func AddIssueCommentReaction(t translations.TranslationHelperFunc) inventory.Ser
13071307
},
13081308
"comment_id": {
13091309
Type: "number",
1310-
Description: "The issue comment ID",
1310+
Description: "The issue or pull request comment ID",
13111311
Minimum: jsonschema.Ptr(1.0),
13121312
},
13131313
"content": {

pkg/github/pullrequests_granular.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,8 @@ func GranularUnresolveReviewThread(t translations.TranslationHelperFunc) invento
758758
return st
759759
}
760760

761-
// AddPullRequestReviewCommentReaction adds a reaction to a pull request review comment.
762-
func AddPullRequestReviewCommentReaction(t translations.TranslationHelperFunc) inventory.ServerTool {
761+
// GranularAddPullRequestReviewCommentReaction adds a reaction to a pull request review comment.
762+
func GranularAddPullRequestReviewCommentReaction(t translations.TranslationHelperFunc) inventory.ServerTool {
763763
st := NewTool(
764764
ToolsetMetadataPullRequests,
765765
mcp.Tool{

pkg/github/tools.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@ func AllTools(t translations.TranslationHelperFunc) []inventory.ServerTool {
314314
GranularRemoveSubIssue(t),
315315
GranularReprioritizeSubIssue(t),
316316
GranularSetIssueFields(t),
317-
AddIssueReaction(t),
318-
AddIssueCommentReaction(t),
317+
GranularAddIssueReaction(t),
318+
GranularAddIssueCommentReaction(t),
319319

320320
// Granular pull request tools (feature-flagged, replace consolidated update_pull_request/pull_request_review_write)
321321
GranularUpdatePullRequestTitle(t),
@@ -329,7 +329,7 @@ func AllTools(t translations.TranslationHelperFunc) []inventory.ServerTool {
329329
GranularAddPullRequestReviewComment(t),
330330
GranularResolveReviewThread(t),
331331
GranularUnresolveReviewThread(t),
332-
AddPullRequestReviewCommentReaction(t),
332+
GranularAddPullRequestReviewCommentReaction(t),
333333
})
334334
}
335335

0 commit comments

Comments
 (0)