From 02de43236a837eefa40d59ecfef9761043a8f292 Mon Sep 17 00:00:00 2001 From: zeripath Date: Wed, 1 Sep 2021 22:52:38 +0100 Subject: [PATCH] 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 <6543@obermui.de> --- 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 fe763f990..08672dd11 100644 --- a/modules/migrations/gitlab.go +++ b/modules/migrations/gitlab.go @@ -396,12 +396,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++ } @@ -558,12 +561,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++ }