Repository navigation
feat(client-contract): recapture the served document and re-record at apis ccb661792 - #44
Merged
Merged
Conversation
dfo-dev-apis refuses anonymous callers, so `record` against dev answered 403 on every request. `record --cloud-run-token` mints the gcloud account's Google ID token, sends it in `X-Serverless-Authorization` on each request to the base URL's origin, and mints a new one every 45 minutes. Signed storage URLs get no token, and no record holds it.
… apis ccb661792 served/openapi.json comes from dfo-apis ccb661792, and every recorded scenario from its dev deploy. The document gains the analysis, derived, export, frame and share routes (14 paths, 71 schemas) and EnrichmentOptionModel.in_long_layout, true when a long-layout download writes the enrichment with no columns token. Search now binds the ODA disbursement questions to net flows, so ref-one-member follows fetch-spec-party-totals-kept to its Net spec, version and file. The long builds moved to 1968 and 1969.
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.
The client contract's served document and every recorded scenario now come from dfo-apis
ccb661792, the current dev deploy. The document gainsEnrichmentOptionModel.in_long_layout, a boolean, false by default, that is true when a long-layout download writes the enrichment with nocolumnstoken, so the clients can type it. It also gains the 14 analysis, derived, export, frame and share routes and their 71 schemas, which earlier changes to this contract registered codes for without capturing them.Changes
tools/capture_client_contract.py:record --cloud-run-tokensends the gcloud account's Google ID token inX-Serverless-Authorizationto the base URL's origin and mints a new one every 45 minutes, becausedfo-dev-apisrefuses anonymous callers and an unauthenticated record gets 403. Signed storage URLs get no token, and no record holds it. The two READMEs give the flag.served/openapi.jsonandserved/SOURCE.json: captured in process fromccb661792.scenarios/: all 34 recorded scenarios re-recorded against dev atccb661792, and the 92 synthetic ones derived again.refs/ref-one-member.json: followsfetch-spec-party-totals-keptto its new spec, version and file.CHANGELOG.mdandtest_the_long_build_scans_start_after_the_recorded_picks: the new commit, sizes and long-build start years (1968 and 1969).Notes for reviewers
Search on dev now binds "ODA disbursements" to
nettingBasisNet where it bound Gross, so the party-totals scenarios, the long builds andref-one-membername Net specs and say "Net disbursements". The scenarios still pin the party-totals cut and the async build. Check whether Net is the intended reading for that question.The SDK can follow this only after dfo-apis pins spec-kit at or past this commit, since
scripts/check_contract_pin.pyholdscontract/SOURCEto that pin.Testing:
uv run tools/validate_client_contract.pyreports the contract valid with 126 scenarios,pytest tools/testspasses (625),python/client-contractpasses 244 tests with ruff clean, and the registry, unit and vector validators pass. The token transport has a test that checks the token reaches the API origin only and is minted again after 45 minutes.