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

Commit2c007f4

Browse files
authored
Fix GitHub ListPullRequestReviews (#118)
1 parent5004344 commit2c007f4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

‎vcsclient/github.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ func (client *GitHubClient) ListPullRequestReviewComments(ctx context.Context, o
473473
iferr!=nil {
474474
returnnil,err
475475
}
476-
commentsList,_,err:=ghClient.PullRequests.ListReviews(ctx,owner,repository,pullRequestID,nil)
476+
commentsList,_,err:=ghClient.PullRequests.ListComments(ctx,owner,repository,pullRequestID,nil)
477477
iferr!=nil {
478478
return []CommentInfo{},err
479479
}
@@ -482,7 +482,7 @@ func (client *GitHubClient) ListPullRequestReviewComments(ctx context.Context, o
482482
commentsInfoList=append(commentsInfoList,CommentInfo{
483483
ID:comment.GetID(),
484484
Content:comment.GetBody(),
485-
Created:comment.GetSubmittedAt(),
485+
Created:comment.GetCreatedAt(),
486486
})
487487
}
488488
returncommentsInfoList,nil

‎vcsclient/github_test.go‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,14 +314,16 @@ func TestGitHubClient_ListPullRequestReviewComments(t *testing.T) {
314314
ctx:=context.Background()
315315
id:=int64(1)
316316
body:="test"
317-
client,cleanUp:=createServerAndClient(t,vcsutils.GitHub,false, []*github.PullRequestReview{{ID:&id,Body:&body}},"/repos/jfrog/repo-1/pulls/1/reviews",createGitHubHandler)
317+
created:=time.Date(1970,time.January,1,0,0,0,0,time.UTC)
318+
client,cleanUp:=createServerAndClient(t,vcsutils.GitHub,false, []*github.PullRequestComment{{ID:&id,Body:&body,CreatedAt:&created}},"/repos/jfrog/repo-1/pulls/1/comments",createGitHubHandler)
318319
defercleanUp()
319320

320321
commentInfo,err:=client.ListPullRequestReviewComments(ctx,owner,repo1,1)
321322
assert.NoError(t,err)
322323
assert.Len(t,commentInfo,1)
323324
assert.Equal(t,id,commentInfo[0].ID)
324325
assert.Equal(t,body,commentInfo[0].Content)
326+
assert.Equal(t,created,commentInfo[0].Created)
325327

326328
commentInfo,err=createBadGitHubClient(t).ListPullRequestReviewComments(ctx,owner,repo1,1)
327329
assert.Nil(t,commentInfo)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp