(projectID int, mergeRequestID int)
| 217 | } |
| 218 | |
| 219 | func (s *SCM) ListMergeRequestNotes(projectID int, mergeRequestID int) (comments []*models.Comment, err error) { |
| 220 | comments = []*models.Comment{} |
| 221 | |
| 222 | opt := &github.PullRequestListCommentsOptions{ |
| 223 | ListOptions: github.ListOptions{ |
| 224 | PerPage: perPageItemCount, |
| 225 | }, |
| 226 | } |
| 227 | |
| 228 | repo, _, err := s.client.Repositories.GetByID(s.ctx, int64(projectID)) |
| 229 | |
| 230 | if err != nil { |
| 231 | return comments, err |
| 232 | } |
| 233 | |
| 234 | owner := repo.GetOwner().GetLogin() |
| 235 | if repo.GetFork() { |
| 236 | owner = repo.GetParent().GetOwner().GetLogin() |
| 237 | } |
| 238 | |
| 239 | for { |
| 240 | data, rsp, err := s.client.PullRequests.ListComments(s.ctx, owner, repo.GetName(), int(mergeRequestID), opt) |
| 241 | if err != nil { |
| 242 | return comments, err |
| 243 | } |
| 244 | |
| 245 | if len(data) == 0 { |
| 246 | break |
| 247 | } |
| 248 | |
| 249 | comments = append(comments, s.convertGithubPullRequestsCommentsToComments(data)...) |
| 250 | |
| 251 | if rsp.NextPage == 0 { |
| 252 | break |
| 253 | } |
| 254 | |
| 255 | opt.Page = rsp.NextPage |
| 256 | } |
| 257 | return comments, nil |
| 258 | } |
| 259 | |
| 260 | func (s *SCM) ListUsers() (users models.Users, err error) { |
| 261 | users = models.Users{} |
nothing calls this directly
no test coverage detected