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

Commitef16fd8

Browse files
fix lint errors
1 parent9403161 commitef16fd8

File tree

3 files changed

+9
-23
lines changed

3 files changed

+9
-23
lines changed

‎pkg/errors/error.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func GetGitHubGraphQLErrors(ctx context.Context) ([]*GitHubGraphQLError, error)
8585
funcNewGitHubAPIErrorToCtx(ctx context.Context,messagestring,resp*github.Response,errerror) (context.Context,error) {
8686
apiErr:=newGitHubAPIError(message,resp,err)
8787
ifctx!=nil {
88-
addGitHubAPIErrorToContext(ctx,apiErr)
88+
_,_=addGitHubAPIErrorToContext(ctx,apiErr)// Explicitly ignore error for graceful handling
8989
}
9090
returnctx,nil
9191
}
@@ -110,7 +110,7 @@ func addGitHubGraphQLErrorToContext(ctx context.Context, err *GitHubGraphQLError
110110
funcNewGitHubAPIErrorResponse(ctx context.Context,messagestring,resp*github.Response,errerror)*mcp.CallToolResult {
111111
apiErr:=newGitHubAPIError(message,resp,err)
112112
ifctx!=nil {
113-
addGitHubAPIErrorToContext(ctx,apiErr)
113+
_,_=addGitHubAPIErrorToContext(ctx,apiErr)// Explicitly ignore error for graceful handling
114114
}
115115
returnmcp.NewToolResultErrorFromErr(message,err)
116116
}
@@ -119,7 +119,7 @@ func NewGitHubAPIErrorResponse(ctx context.Context, message string, resp *github
119119
funcNewGitHubGraphQLErrorResponse(ctx context.Context,messagestring,errerror)*mcp.CallToolResult {
120120
graphQLErr:=newGitHubGraphQLError(message,err)
121121
ifctx!=nil {
122-
addGitHubGraphQLErrorToContext(ctx,graphQLErr)
122+
_,_=addGitHubGraphQLErrorToContext(ctx,graphQLErr)// Explicitly ignore error for graceful handling
123123
}
124124
returnmcp.NewToolResultErrorFromErr(message,err)
125125
}

‎pkg/github/actions.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ func handleFailedJobLogs(ctx context.Context, client *github.Client, owner, repo
680680
"error":err.Error(),
681681
}
682682
// Enable reporting of status codes and error causes
683-
ghErrors.NewGitHubAPIErrorToCtx(ctx,"failed to get job logs",resp,err)
683+
_,_=ghErrors.NewGitHubAPIErrorToCtx(ctx,"failed to get job logs",resp,err)// Explicitly ignore error for graceful handling
684684
}
685685

686686
logResults=append(logResults,jobResult)
@@ -736,11 +736,11 @@ func getJobLogData(ctx context.Context, client *github.Client, owner, repo strin
736736

737737
ifreturnContent {
738738
// Download and return the actual log content
739-
content,resp,err:=downloadLogContent(url.String())
739+
content,httpResp,err:=downloadLogContent(url.String())//nolint:bodyclose // Response body is closed in downloadLogContent, but we need to return httpResp
740740
iferr!=nil {
741741
// To keep the return value consistent wrap the response as a GitHub Response
742742
ghRes:=&github.Response{
743-
Response:resp,
743+
Response:httpResp,
744744
}
745745
returnnil,ghRes,fmt.Errorf("failed to download log content for job %d: %w",jobID,err)
746746
}

‎pkg/github/pullrequests_test.go

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -275,31 +275,17 @@ func Test_UpdatePullRequest(t *testing.T) {
275275
result,err:=handler(context.Background(),request)
276276

277277
// Verify results
278-
iftc.expectError {
278+
iftc.expectError||tc.expectedErrMsg!=""{
279279
require.NoError(t,err)
280280
require.True(t,result.IsError)
281281
errorContent:=getErrorResult(t,result)
282-
assert.Contains(t,errorContent.Text,tc.expectedErrMsg)
283-
return
284-
}
285-
286-
require.NoError(t,err)
287-
288-
// Check for expected error message within the result text
289-
iftc.expectedErrMsg!="" {
290-
iftc.expectError {
291-
require.True(t,result.IsError)
292-
errorContent:=getErrorResult(t,result)
293-
assert.Contains(t,errorContent.Text,tc.expectedErrMsg)
294-
}else {
295-
// Special case: error message returned as MCP error result, not Go error
296-
require.True(t,result.IsError)
297-
errorContent:=getErrorResult(t,result)
282+
iftc.expectedErrMsg!="" {
298283
assert.Contains(t,errorContent.Text,tc.expectedErrMsg)
299284
}
300285
return
301286
}
302287

288+
require.NoError(t,err)
303289
require.False(t,result.IsError)
304290

305291
// Parse the result and get the text content

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp