feat(raw): reuse deterministic range resolution - #418
Open
BramVR wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR unifies raw Data Type range/timezone resolution with sync by reusing sync’s deterministic named-range grammar, timezone precedence (flag → config → UTC), and captured clock behavior, while adding early validation so meaningless range/timezone flags on identity endpoints and non-listable Data Types fail before any config/archive/provider I/O.
Changes:
- Added a raw-specific range resolver entrypoint (
ResolveRawRange) that shares sync’s core boundary logic but preserves accurate command context in errors. - Reworked raw request building to accept a full
RawRequestOptionscontract (including flag provenance) and added a pre-setup validation pass. - Updated CLI surface/docs/tests (including a dedicated raw timezone/range test suite) to reflect new grammar, timezone precedence, and identity flag rejection.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| skills/gohealthcli/SKILL.md | Updates raw examples to use named ranges + timezone and clarifies behavior parity with sync. |
| README.md | Aligns README raw usage and adds notes on shared range grammar and identity flag rejection. |
| internal/googlehealth/range_resolver.go | Factors range resolution behind resolveRange and adds ResolveRawRange for raw-context errors. |
| internal/googlehealth/fetch.go | Introduces RawRequestOptions, early validation, and unified raw request parsing/building with captured clock. |
| internal/googlehealth/fetch_extra_test.go | Updates internal tests to the new BuildRawRequest(RawRequestOptions) contract. |
| docs/quickstart.md | Refreshes quickstart raw examples and documents timezone/range behavior. |
| docs/commands/raw.md | Expands raw command docs to describe named boundary grammar, timezone precedence, and identity flag rejection; adds --timezone flag row. |
| cmd/gohealthcli/raw.go | Adds --timezone, performs pre-setup option validation, captures clock, applies config timezone default, and threads config into setup. |
| cmd/gohealthcli/raw_timezone_test.go | Adds comprehensive fake-provider tests for raw named ranges, timezone precedence, alias parity, early rejection, and no-write assertions. |
| cmd/gohealthcli/google_health_fetch_test.go | Updates request-building tests for the new options-based raw request builder and resolved range semantics. |
| cmd/gohealthcli/completion_test.go | Adds completion coverage for raw --timezone. |
| cmd/gohealthcli/commands.go | Updates raw command registry metadata and flag surface to include --timezone and updated long help text. |
| cmd/gohealthcli/agent_skill_test.go | Updates agent skill drift test to use the new raw request builder contract. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Proof
Formatting: make fmt-check
Lint: pinned golangci-lint v2.12.2, 0 issues
Tests: go test ./... and go test -race ./...
Docs: make docs-check
Project Site: make docs-site
Live proof attached or explained below
Docs/changelog impact reviewed; docs updated, repository has no changelog
Public artifact confidentiality gate reviewed
focused fake-Provider tests: alias parity; raw/sync byte-identical filters for physical, civil, and daily shapes; DST/config/flag/clock boundaries; pre-I/O validation; no-write assertions
go vet ./...; native macOS build; Linux amd64 and Windows amd64 cross-builds
go mod verify; go mod tidy -diff; govulncheck: no vulnerabilities
confidentiality gate and Public Model Identifier Gate: PASS
exact-head Codex AutoReview: clean (0.93); exact-head Claude Opus 4.8 review: clean (0.72)
Notes