MCPcopy Create free account
hub / github.com/c1982/swe-dashboard / ListMergeRequestNotes

Method ListMergeRequestNotes

internal/scm/github/scm.go:219–258  ·  view source on GitHub ↗
(projectID int, mergeRequestID int)

Source from the content-addressed store, hash-verified

217}
218
219func (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
260func (s *SCM) ListUsers() (users models.Users, err error) {
261 users = models.Users{}

Callers

nothing calls this directly

Implementers 1

SCMinternal/scm/gitlab/scm.go

Tested by

no test coverage detected