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:
Steve Yegge
2025-10-19 19:42:35 -07:00
parent e97c122feb
commit 0c888d13bb
2 changed files with 149 additions and 143 deletions

View File

@@ -861,6 +861,12 @@ func autoImportIfNewer() {
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)
}