Skip to content

Commit 7062614

Browse files
authored
Gitlab Migrator: dont ignore reactions of last request (#16903)
Fix bug related to early breaking when migrating reactions.
1 parent 57b0887 commit 7062614

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

modules/migrations/gitlab.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -421,12 +421,15 @@ func (g *GitlabDownloader) GetIssues(page, perPage int) ([]*base.Issue, bool, er
421421
if err != nil {
422422
return nil, false, fmt.Errorf("error while listing issue awards: %v", err)
423423
}
424-
if len(awards) < perPage {
425-
break
426-
}
424+
427425
for i := range awards {
428426
reactions = append(reactions, g.awardToReaction(awards[i]))
429427
}
428+
429+
if len(awards) < perPage {
430+
break
431+
}
432+
430433
awardPage++
431434
}
432435

@@ -584,12 +587,15 @@ func (g *GitlabDownloader) GetPullRequests(page, perPage int) ([]*base.PullReque
584587
if err != nil {
585588
return nil, false, fmt.Errorf("error while listing merge requests awards: %v", err)
586589
}
587-
if len(awards) < perPage {
588-
break
589-
}
590+
590591
for i := range awards {
591592
reactions = append(reactions, g.awardToReaction(awards[i]))
592593
}
594+
595+
if len(awards) < perPage {
596+
break
597+
}
598+
593599
awardPage++
594600
}
595601

0 commit comments

Comments
 (0)