Skip to content

Commit

Permalink
Gitlab Migrator: dont ignore reactions of last request (#16903) (#16913)
Browse files Browse the repository at this point in the history
Backport #16903

Fix bug related to early breaking when migrating reactions.

Co-authored-by: 6543 <[email protected]>
  • Loading branch information
zeripath and 6543 authored Sep 1, 2021
1 parent f949f9e commit 02de432
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 @@ -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++
}

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

Expand Down

0 comments on commit 02de432

Please sign in to comment.