Skip to content

Commit c9cda90

Browse files
committed
refactor: address code style nitpicks in MarkPullRequestReadyForReview
Based on code review feedback, made the following improvements: - Rename 'variables' to 'vars' for consistency with other GraphQL functions - Improve comment precision for GraphQL schema requirements These changes enhance code consistency and documentation clarity while maintaining full functionality. All tests, linting, and build checks pass.
1 parent ad2ce64 commit c9cda90

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/github/pullrequests.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,7 @@ func MarkPullRequestReadyForReview(getGQLClient GetGQLClientFn, t translations.T
16431643
// Get the GraphQL client
16441644
client, err := getGQLClient(ctx)
16451645
if err != nil {
1646-
return nil, fmt.Errorf("failed to get GitHub GraphQL client: %w", err)
1646+
return mcp.NewToolResultError(fmt.Sprintf("failed to get GitHub GraphQL client: %v", err)), nil
16471647
}
16481648

16491649
// First, we need to get the GraphQL ID of the pull request
@@ -1656,13 +1656,13 @@ func MarkPullRequestReadyForReview(getGQLClient GetGQLClientFn, t translations.T
16561656
} `graphql:"repository(owner: $owner, name: $repo)"`
16571657
}
16581658

1659-
variables := map[string]any{
1659+
vars := map[string]any{
16601660
"owner": githubv4.String(params.Owner),
16611661
"repo": githubv4.String(params.Repo),
16621662
"prNum": githubv4.Int(params.PullNumber),
16631663
}
16641664

1665-
if err := client.Query(ctx, &getPullRequestQuery, variables); err != nil {
1665+
if err := client.Query(ctx, &getPullRequestQuery, vars); err != nil {
16661666
return mcp.NewToolResultError(fmt.Sprintf("failed to get pull request: %v", err)), nil
16671667
}
16681668

@@ -1675,7 +1675,7 @@ func MarkPullRequestReadyForReview(getGQLClient GetGQLClientFn, t translations.T
16751675
var markReadyForReviewMutation struct {
16761676
MarkPullRequestReadyForReview struct {
16771677
PullRequest struct {
1678-
ID githubv4.ID // We don't need this, but a selector is required or GQL complains
1678+
ID githubv4.ID // Required by GraphQL schema, but not used in response
16791679
}
16801680
} `graphql:"markPullRequestReadyForReview(input: $input)"`
16811681
}

0 commit comments

Comments
 (0)