aboutsummaryrefslogtreecommitdiffstats
path: root/services/migrations/gitlab.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/migrations/gitlab.go')
-rw-r--r--services/migrations/gitlab.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/services/migrations/gitlab.go b/services/migrations/gitlab.go
index a9856739c2..97ebc4dd8b 100644
--- a/services/migrations/gitlab.go
+++ b/services/migrations/gitlab.go
@@ -640,13 +640,22 @@ func (g *GitlabDownloader) GetReviews(context base.IssueContext) ([]*base.Review
return nil, err
}
+ var createdAt time.Time
+ if approvals.CreatedAt != nil {
+ createdAt = *approvals.CreatedAt
+ } else if approvals.UpdatedAt != nil {
+ createdAt = *approvals.UpdatedAt
+ } else {
+ createdAt = time.Now()
+ }
+
reviews := make([]*base.Review, 0, len(approvals.ApprovedBy))
for _, user := range approvals.ApprovedBy {
reviews = append(reviews, &base.Review{
IssueIndex: context.LocalID(),
ReviewerID: int64(user.User.ID),
ReviewerName: user.User.Username,
- CreatedAt: *approvals.UpdatedAt,
+ CreatedAt: createdAt,
// All we get are approvals
State: base.ReviewStateApproved,
})