fix(backend): embed the IANA time-zone database #297

Merged
developer merged 1 commits from feature/embed-tzdata into development 2026-07-28 14:59:54 +00:00
Owner

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.Load refuses 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-debian12 carries 1308 zones including Europe/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 blank time/tzdata import 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.

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.Load` refuses 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-debian12` carries 1308 zones including `Europe/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 blank `time/tzdata` import 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.
developer added 1 commit 2026-07-28 14:56:39 +00:00
fix(backend): embed the IANA time-zone database
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 12s
CI / integration (pull_request) Successful in 20s
CI / ui (pull_request) Has been skipped
CI / conformance (pull_request) Successful in 11s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m51s
ca9cc90db9
The taxpayer's zone decides which tax month an income is filed under, and the
config refuses to boot on a zone it cannot resolve rather than misfiling into
UTC. That correctness was resting on the base image happening to ship
/usr/share/zoneinfo — true of distroless/static-debian12 today, but not a thing
to leave implicit on a path where being wrong means a wrong tax return.

Costs about 450 KB of binary. Adds a config test pinning the default zone and
the hard failure on an unknown one.
owner approved these changes 2026-07-28 14:56:47 +00:00
developer merged commit 3a1c1ec825 into development 2026-07-28 14:59:54 +00:00
developer deleted branch feature/embed-tzdata 2026-07-28 14:59:54 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: developer/scrabble-game#297