* fix(import): normalize optional timestamps to UTC on insert
On JSONL import, an optional timestamp carrying a non-UTC offset (e.g. a
closed_at of `...-04:00` from an older SQLite-era export) kept its local
wall-clock digits: created_at/updated_at were normalized to UTC on insert
but closed_at and the other optional pointer timestamps were not, so the
stored instant shifted by the host's UTC offset while every other field
round-tripped cleanly.
Add Issue.NormalizeOptionalTimestampsToUTC and call it from both insert
paths (embedded PrepareIssueForInsert and proxied-server
normalizeIssueTimestamps) so started_at, closed_at, compacted_at, due_at,
defer_until, lease_expires_at and heartbeat_at are converted to true UTC,
exactly as created_at/updated_at already are.
Fixes#5765
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore(bazel): enumerate the two new UTC-normalization test files in go_test srcs
gazelle-generated, one line per package, both packages owned by this PR.
Each file is untagged so its go_test target owes the enumeration; the
in-package census showed the gap was exactly these two with zero
pre-existing untagged gaps (59 vs 58, 61 vs 60).
* review: correct the domain/db mechanism claim and pin the full timestamp set
Applies the two optional in-PR minors from the bd-s0msb iteration-1 review
synthesis (both Gate impact: none; the synthesis and scorecard both decided
approve with zero blockers and zero majors).
- normalize_timestamps_utc_test.go header claimed this route covers "the
proxied-server insert path share of #5765". It does not: domain/db runs on
go-sql-driver, whose DSN Loc defaults to time.UTC and which converts bound
time.Time values into that location on both the interpolate and prepared
paths, and no production DSN sets loc=. The embedded route is the one that
discards offsets, formatting in the value own zone via vitess
BuildBindVariable. Reworded to state the call is defense-in-depth for parity
with the embedded path. The test body is unchanged and still passes.
- NormalizeOptionalTimestampsToUTC hand-enumerates its 7 *time.Time fields to
keep the insert path free of reflection, but the two new tests assert only 5
of them, leaving LeaseExpiresAt and HeartbeatAt normalized yet unasserted, so
an 8th field added later would be skipped silently. Adds a reflection-driven
drift tripwire that walks Issue, sets every *time.Time to a fixed non-UTC
zone, and fails on any field left off UTC. Dropping &i.HeartbeatAt from the
helper reds it naming HeartbeatAt while both pre-existing tests stay green.
No production code changes. The tripwire went into the existing types_test.go,
so no new go_test src is owed in internal/types/BUILD.bazel.
---------
Co-authored-by: Ben Younes <2910651+ousamabenyounes@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>