Skip to content

Commit 43d6692

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 4fd3da5 commit 43d6692

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
@@ -1642,7 +1642,7 @@ func MarkPullRequestReadyForReview(getGQLClient GetGQLClientFn, t translations.T
16421642
// Get the GraphQL client
16431643
client, err := getGQLClient(ctx)
16441644
if err != nil {
1645-
return nil, fmt.Errorf("failed to get GitHub GraphQL client: %w", err)
1645+
return mcp.NewToolResultError(fmt.Sprintf("failed to get GitHub GraphQL client: %v", err)), nil
16461646
}
16471647

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

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

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

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

0 commit comments

Comments
 (0)