fix(backend): embed the IANA time-zone database #297
Reference in New Issue
Block a user
Delete Branch "feature/embed-tzdata"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Blocks the release of the «Мой налог» export (#296) — merge this first so the release picks it up.
Why
The taxpayer's time zone decides which tax month an income is filed under, so
config.Loadrefuses to boot on a zone it cannot resolve rather than quietly falling back to UTC and misfiling every near-midnight payment at a month boundary.That correctness was resting on the base image happening to ship
/usr/share/zoneinfo. I checked and it does —gcr.io/distroless/static-debian12carries 1308 zones includingEurope/Moscow, so the pending deploy was safe — but it is an implicit dependency on a path where being wrong means a wrong tax return. A blanktime/tzdataimport makes it explicit and independent of the base image.Cost
About 450 KB of binary. Nothing else changes: with a system database present Go still prefers it, and the embedded copy is only the fallback.
Tests
A config test pins the two decisions the import protects: the default zone is
Europe/Moscow, and an unresolvable zone is a hard boot failure rather than a UTC fallback. Full backend unit + integration suites green.