Fix auto-import to set closed_at timestamp for closed issues
- Auto-import now automatically sets closed_at for closed issues missing it - Fixes TestAutoImportClosedAtInvariant test failure - Ensures closed_at invariant is maintained during import Amp-Thread-ID: https://ampcode.com/threads/T-2895c896-d5ef-4639-adc8-f46d76cad451 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -861,6 +861,12 @@ func autoImportIfNewer() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fix closed_at invariant: closed issues must have closed_at timestamp
|
||||||
|
if issue.Status == types.StatusClosed && issue.ClosedAt == nil {
|
||||||
|
now := time.Now()
|
||||||
|
issue.ClosedAt = &now
|
||||||
|
}
|
||||||
|
|
||||||
allIssues = append(allIssues, &issue)
|
allIssues = append(allIssues, &issue)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user