Skip to content

Commit cfa3f80

Browse files
Merge pull request #494 from zakisk/add-pagination-in-pr-list-comments
fix: Add Pagination in Pull Request ListComments on Bitbucket Server …
2 parents d0a53f2 + 4048e85 commit cfa3f80

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

scm/driver/stash/pr.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func (s *pullService) ListComments(ctx context.Context, repo string, number int,
100100

101101
projectName, repoName := scm.Split(repo)
102102
out := new(pullRequestActivities)
103-
path := fmt.Sprintf("rest/api/1.0/projects/%s/repos/%s/pull-requests/%d/activities", projectName, repoName, number)
103+
path := fmt.Sprintf("rest/api/1.0/projects/%s/repos/%s/pull-requests/%d/activities?%s", projectName, repoName, number, encodeListOptions(opts))
104104
res, err := s.client.do(ctx, "GET", path, nil, out)
105105
if !out.pagination.LastPage.Bool {
106106
res.Page.First = 1
@@ -501,6 +501,7 @@ func convertPullRequestComment(from *pullRequestComment) *scm.Comment {
501501
Created: time.Unix(from.CreatedDate/1000, 0),
502502
Updated: time.Unix(from.UpdatedDate/1000, 0),
503503
Author: scm.User{
504+
ID: from.Author.ID,
504505
Login: from.Author.Slug,
505506
Name: from.Author.DisplayName,
506507
Email: from.Author.EmailAddress,

scm/driver/stash/testdata/pr_comment.json.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"ID": 1,
33
"Body": "this is a comment",
44
"Author": {
5+
"ID": 1,
56
"Login": "jcitizen",
67
"Name": "Jane Citizen",
78
"Email": "[email protected]",

scm/driver/stash/testdata/pr_comments.json.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"ID": 1,
44
"Body": "A measured reply.",
55
"Author": {
6+
"ID": 101,
67
"Login": "jcitizen",
78
"Name": "Jane Citizen",
89
"Email": "[email protected]",

0 commit comments

Comments
 (0)