@@ -353,13 +353,15 @@ func (s service) ListTimeline(ctx context.Context, rs string, id uint64, opt *ch
State githubql.PullRequestReviewState
Body string
ViewerCanUpdate bool
Comments struct {
Nodes []struct {
DatabaseID uint64
Path string
OriginalPosition int
Body string
ReactionGroups reactionGroups
}
} `graphql:"comments(first:100)"` // TODO: Pagination... Figure out how to make pagination across 2 resource types work...
}
} `graphql:"reviews(first:100)"` // TODO: Pagination... Figure out how to make pagination across 2 resource types work...
} `graphql:"pullRequest(number:$prNumber)"`
@@ -425,13 +427,15 @@ func (s service) ListTimeline(ctx context.Context, rs string, id uint64, opt *ch
}
}
var cs []change.InlineComment
for _, comment := range review.Comments.Nodes {
cs = append(cs, change.InlineComment{
File: comment.Path,
Line: comment.OriginalPosition,
Body: comment.Body,
ID: comment.DatabaseID,
File: comment.Path,
Line: comment.OriginalPosition,
Body: comment.Body,
Reactions: s.reactions(comment.ReactionGroups),
})
}
sort.Slice(cs, func(i, j int) bool {
if cs[i].File == cs[j].File {
return cs[i].Line < cs[j].Line