From 7062614deeb7dd76a6a0a0426e5cce96055e9a0c Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 1 Sep 2021 12:20:19 +0200 Subject: [PATCH] Gitlab Migrator: dont ignore reactions of last request (#16903) Fix bug related to early breaking when migrating reactions. --- modules/migrations/gitlab.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/modules/migrations/gitlab.go b/modules/migrations/gitlab.go index d5bf2d2d76..91ba073d18 100644 --- a/modules/migrations/gitlab.go +++ b/modules/migrations/gitlab.go @@ -421,12 +421,15 @@ func (g *GitlabDownloader) GetIssues(page, perPage int) ([]*base.Issue, bool, er if err != nil { return nil, false, fmt.Errorf("error while listing issue awards: %v", err) } - if len(awards) < perPage { - break - } + for i := range awards { reactions = append(reactions, g.awardToReaction(awards[i])) } + + if len(awards) < perPage { + break + } + awardPage++ } @@ -584,12 +587,15 @@ func (g *GitlabDownloader) GetPullRequests(page, perPage int) ([]*base.PullReque if err != nil { return nil, false, fmt.Errorf("error while listing merge requests awards: %v", err) } - if len(awards) < perPage { - break - } + for i := range awards { reactions = append(reactions, g.awardToReaction(awards[i])) } + + if len(awards) < perPage { + break + } + awardPage++ }