Repository navigation
chore: import the time zone data explicitly - #4204
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
🟢 Coverage ∅ diff coverage · 0.00% coverage variation
Metric Results Coverage variation ✅ 0.00% coverage variation (-1.00%) Diff coverage ✅ ∅ diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (4154dcd) 99485 32810 32.98% Head commit (6e56885) 99485 (+0) 32809 (-1) 32.98% (0.00%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#4204) 0 0 ∅ (not applicable) Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Pull Request Overview
✅ No blocking issues noticed
No blocking implementation issues were identified. The main risk is that the time-zone fallback and related local-time behavior lack automated coverage, so regressions may go undetected.
About this PR
- Add automated coverage for the container fallback, system time zone compatibility, and local-time consumers such as revision cleanup. Consider documenting the behavior change for deployments using non-UTC TZ settings.
Test suggestions
- Run the binary without system time zone files with TZ set to a non-UTC zone and verify local time uses that zone.
- Verify behavior remains compatible on systems with system time zone files.
- Verify revision cleanup uses the configured local time zone.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Run the binary without system time zone files with TZ set to a non-UTC zone and verify local time uses that zone.
2. Verify behavior remains compatible on systems with system time zone files.
3. Verify revision cleanup uses the configured local time zone.
TIP How was this review? Give us feedback
787b9ff to
930d3fc
Compare
With TZ, the revision cleanup counts days in that time zone (opencloud-eu#4200). The container image (alpine) has no time zone files, so TZ only works there because the binary embeds the time zone data, which today it does only because a dependency, OPA, imports time/tzdata. Import it explicitly, so that TZ doesn't stop working unnoticed when that dependency changes. No change in behavior, nor in the size of the binary. opencloud-eu#4200 Assisted-by: Claude Code:claude-opus-5-5
930d3fc to
6e56885
Compare
Related to #4200.
With
TZ, the revision cleanup counts days in that time zone (#4200, opencloud-eu/reva#1097). The container image (alpine) has no time zone files, soTZonly works there because the binary embeds the time zone data. Today, it does so only because a dependency, OPA, importstime/tzdata(vendor/github.com/open-policy-agent/opa/v1/topdown/time.go). This imports it explicitly, so thatTZdoesn't stop working unnoticed when that dependency changes.No change in behavior, nor in the size of the binary: a stripped build is 114,025,672 bytes with and without the import. Go uses the embedded data only as a fallback, after the time zone files of the system, so where the system has more recent ones, those still win.
(This PR first claimed that
TZdoesn't work in the image at all, see #4205, closed: that was a test with a separate Go program instead ofopencloud.)AI assistance: Claude Code (claude-opus-5-5) wrote the change and this description, and measured the binary sizes; I reviewed them.