Skip to content

feat(config): persist the range-resolution timezone - #417

Merged
BramVR merged 2 commits into
mainfrom
codex/issue-403-timezone-config
Jul 31, 2026
Merged

feat(config): persist the range-resolution timezone#417
BramVR merged 2 commits into
mainfrom
codex/issue-403-timezone-config

Conversation

@BramVR

@BramVR BramVR commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Outcome

  • persist a root timezone config value and add init --timezone, with new configs writing UTC explicitly
  • resolve named sync boundaries by --timezone flag, then config, then implicit UTC for legacy configs
  • embed IANA timezone data for cross-platform builds; never infer from the machine, Provider, Data Points, locale, or IP
  • reject explicit empty or invalid flag/config values before provider calls, archive writes, or setup creation
  • expose the resolved timezone through doctor and update the command registry plus generated docs

Closes #403

Proof

  • vertical regression coverage for init persistence/rejection, config precedence, legacy UTC, machine-TZ non-inference, doctor output, and pre-effect sync rejection
  • go test ./... -count=1
  • go test -race ./... -count=1
  • make fmt-check and go vet ./...
  • repository-pinned lint: 0 issues
  • make docs-check and make docs-site
  • stamped macOS arm64 binary runtime proof: explicit timezone persisted/reported; empty timezone failed before files existed
  • Linux amd64 static binary and Windows amd64 binary cross-build; hosted Linux/Windows execution remains required
  • go mod verify and go mod tidy -diff
  • reachability vulnerability scan: no vulnerabilities found
  • Public Model Identifier Gate and production confidentiality gate: clean
  • default structured autoreview and required API-boundary second-engine autoreview: clean

Risk and scope

No schema, migration, provider contract, credential, release, version, tag, or dependency changes. Existing configs without timezone remain UTC. The prior named-range implementation landed in #416 and is the only feature dependency; this PR is scoped to persisted resolution policy and doctor exposure.

Copilot AI review requested due to automatic review settings July 31, 2026 11:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a persisted root timezone configuration and threads that resolved timezone through init, sync preflight, and doctor, while embedding IANA tzdata to ensure cross-platform timezone resolution without relying on machine-local settings.

Changes:

  • Add root timezone config persistence (defaulting new configs to explicit UTC) and init --timezone validation.
  • Resolve sync named boundaries using precedence --timezone > config timezone > implicit UTC for legacy configs, and validate invalid/empty zones before any provider/archive effects.
  • Expose the resolved timezone via doctor output and update command registry + generated docs accordingly.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/googlehealth/range_resolver.go Embed tzdata and centralize timezone loading/validation for range resolution.
docs/commands/sync.md Document timezone precedence and updated preflight rejection semantics.
docs/commands/init.md Document init --timezone and explicit UTC persistence in new configs.
docs/commands/doctor.md Document doctor reporting of resolved timezone (including legacy UTC).
cmd/gohealthcli/sync_timezone_test.go Add regression tests for config precedence, legacy UTC behavior, and pre-effect rejection.
cmd/gohealthcli/sync_preflight_gate.go Add config timezone lookup/caching to preflight and pass resolved timezone into range resolver.
cmd/gohealthcli/sync_preflight_gate_test.go Update fake preflight context to provide a configured timezone.
cmd/gohealthcli/result_writer_bytes_test.go Update doctor writer fixtures/expectations to include timezone.
cmd/gohealthcli/init.go Add --timezone flag, validate it early, and persist to config.
cmd/gohealthcli/init_test.go Add tests for timezone persistence and early rejection (invalid/empty).
cmd/gohealthcli/doctor.go Include timezone in doctor JSON/plain/human outputs.
cmd/gohealthcli/doctor_test.go Add coverage for legacy configs reporting implicit UTC timezone.
cmd/gohealthcli/config.go Parse root timezone, validate it, and default legacy configs to UTC.
cmd/gohealthcli/commands.go Update command registry docs for init, sync, and doctor to reflect timezone behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmd/gohealthcli/sync_preflight_gate.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Comment thread cmd/gohealthcli/sync_preflight_gate.go
@BramVR
BramVR merged commit 5a92ff3 into main Jul 31, 2026
7 checks passed
@BramVR
BramVR deleted the codex/issue-403-timezone-config branch July 31, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(config): persist the range-resolution timezone

2 participants