MCPcopy Index your code
hub / github.com/git-bug/git-bug / fillCommentEdits

Method fillCommentEdits

bridge/github/import_mediator.go:198–226  ·  view source on GitHub ↗
(ctx context.Context, item *timelineItem)

Source from the content-addressed store, hash-verified

196}
197
198func (mm *importMediator) fillCommentEdits(ctx context.Context, item *timelineItem) {
199 // Here we are only concerned with timeline items of type issueComment.
200 if item.Typename != "IssueComment" {
201 return
202 }
203 // First: setup message handling while submitting GraphQL queries.
204 comment := &item.IssueComment
205 edits := &comment.UserContentEdits
206 hasEdits := true
207 for hasEdits {
208 for edit := range reverse(edits.Nodes) {
209 if edit.Diff == nil || string(*edit.Diff) == "" {
210 // issueEdit.Diff == nil happen if the event is older than early
211 // 2018, Github doesn't have the data before that. Best we can do is
212 // to ignore the event.
213 continue
214 }
215 select {
216 case <-ctx.Done():
217 return
218 case mm.importEvents <- CommentEditEvent{commentId: comment.Id, userContentEdit: edit}:
219 }
220 }
221 if !edits.PageInfo.HasPreviousPage {
222 break
223 }
224 edits, hasEdits = mm.queryCommentEdits(ctx, comment.Id, edits.PageInfo.EndCursor)
225 }
226}
227
228func (mm *importMediator) queryCommentEdits(ctx context.Context, nid githubv4.ID, cursor githubv4.String) (*userContentEditConnection, bool) {
229 vars := newCommentEditVars()

Callers 1

fillTimelineEventsMethod · 0.95

Calls 2

queryCommentEditsMethod · 0.95
reverseFunction · 0.85

Tested by

no test coverage detected