summaryrefslogtreecommitdiffstats
path: root/modules/migrations/migrate.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/migrations/migrate.go')
-rw-r--r--modules/migrations/migrate.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/modules/migrations/migrate.go b/modules/migrations/migrate.go
index 3b3e318f69..c970ba6920 100644
--- a/modules/migrations/migrate.go
+++ b/modules/migrations/migrate.go
@@ -86,7 +86,7 @@ func MigrateRepository(ctx context.Context, doer *models.User, ownerName string,
return uploader.repo, nil
}
-// migrateRepository will download informations and upload to Uploader, this is a simple
+// migrateRepository will download information and then upload it to Uploader, this is a simple
// process for small repository. For a big repository, save all the data to disk
// before upload is better
func migrateRepository(downloader base.Downloader, uploader base.Uploader, opts base.MigrateOptions) error {
@@ -277,7 +277,19 @@ func migrateRepository(downloader base.Downloader, uploader base.Uploader, opts
// migrate reviews
var allReviews = make([]*base.Review, 0, reviewBatchSize)
for _, pr := range prs {
- reviews, err := downloader.GetReviews(pr.Number)
+ number := pr.Number
+
+ // on gitlab migrations pull number change
+ if pr.OriginalNumber > 0 {
+ number = pr.OriginalNumber
+ }
+
+ reviews, err := downloader.GetReviews(number)
+ if pr.OriginalNumber > 0 {
+ for i := range reviews {
+ reviews[i].IssueIndex = pr.Number
+ }
+ }
if err != nil {
return err
}