(ctx context.Context, issueNode *issueNode)
| 108 | } |
| 109 | |
| 110 | func (mm *importMediator) fillIssueEditEvents(ctx context.Context, issueNode *issueNode) { |
| 111 | edits := &issueNode.UserContentEdits |
| 112 | hasEdits := true |
| 113 | for hasEdits { |
| 114 | for edit := range reverse(edits.Nodes) { |
| 115 | if edit.Diff == nil || string(*edit.Diff) == "" { |
| 116 | // issueEdit.Diff == nil happen if the event is older than early |
| 117 | // 2018, Github doesn't have the data before that. Best we can do is |
| 118 | // to ignore the event. |
| 119 | continue |
| 120 | } |
| 121 | select { |
| 122 | case <-ctx.Done(): |
| 123 | return |
| 124 | case mm.importEvents <- IssueEditEvent{issueId: issueNode.issue.Id, userContentEdit: edit}: |
| 125 | } |
| 126 | } |
| 127 | if !edits.PageInfo.HasPreviousPage { |
| 128 | break |
| 129 | } |
| 130 | edits, hasEdits = mm.queryIssueEdits(ctx, issueNode.issue.Id, edits.PageInfo.EndCursor) |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | func (mm *importMediator) queryIssueEdits(ctx context.Context, nid githubv4.ID, cursor githubv4.String) (*userContentEditConnection, bool) { |
| 135 | vars := newIssueEditVars() |
no test coverage detected