Skip to content

Commit

Permalink
Gitlab Migrator: dont ignore reactions of last request (#16903)
Browse files Browse the repository at this point in the history
Fix bug related to early breaking when migrating reactions.
  • Loading branch information
6543 committed Sep 1, 2021
1 parent 57b0887 commit 7062614
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions modules/migrations/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -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++
}

Expand Down Expand Up @@ -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++
}

Expand Down

0 comments on commit 7062614

Please sign in to comment.