Skip to content

Commit 02de432

Browse files
zeripath6543
andauthored
Gitlab Migrator: dont ignore reactions of last request (#16903) (#16913)
Backport #16903 Fix bug related to early breaking when migrating reactions. Co-authored-by: 6543 <[email protected]>
1 parent f949f9e commit 02de432

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
@@ -396,12 +396,15 @@ func (g *GitlabDownloader) GetIssues(page, perPage int) ([]*base.Issue, bool, er
396396
if err != nil {
397397
return nil, false, fmt.Errorf("error while listing issue awards: %v", err)
398398
}
399-
if len(awards) < perPage {
400-
break
401-
}
399+
402400
for i := range awards {
403401
reactions = append(reactions, g.awardToReaction(awards[i]))
404402
}
403+
404+
if len(awards) < perPage {
405+
break
406+
}
407+
405408
awardPage++
406409
}
407410

@@ -558,12 +561,15 @@ func (g *GitlabDownloader) GetPullRequests(page, perPage int) ([]*base.PullReque
558561
if err != nil {
559562
return nil, false, fmt.Errorf("error while listing merge requests awards: %v", err)
560563
}
561-
if len(awards) < perPage {
562-
break
563-
}
564+
564565
for i := range awards {
565566
reactions = append(reactions, g.awardToReaction(awards[i]))
566567
}
568+
569+
if len(awards) < perPage {
570+
break
571+
}
572+
567573
awardPage++
568574
}
569575

0 commit comments

Comments
 (0)