Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit71b0916

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 requirementsThese changes enhance code consistency and documentation clarity whilemaintaining full functionality. All tests, linting, and build checks pass.
1 parent7801e97 commit71b0916

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
iferr!=nil {
1645-
returnnil,fmt.Errorf("failed to get GitHub GraphQL client: %w",err)
1645+
returnmcp.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-
iferr:=client.Query(ctx,&getPullRequestQuery,variables);err!=nil {
1664+
iferr:=client.Query(ctx,&getPullRequestQuery,vars);err!=nil {
16651665
returnmcp.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
varmarkReadyForReviewMutationstruct {
16751675
MarkPullRequestReadyForReviewstruct {
16761676
PullRequeststruct {
1677-
ID githubv4.ID//We don't need this, buta selector is required or GQL complains
1677+
ID githubv4.ID//Required by GraphQL schema, butnot used in response
16781678
}
16791679
}`graphql:"markPullRequestReadyForReview(input: $input)"`
16801680
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp