Repository navigation
Conversation
…se URL rule A POST for a build identical to one pending or running returns that operation, so a client that stops waiting can post again to join it. fetch waits with no whole-call deadline by default, and a download that delivers no byte for 30 s is a retryable network_error. The new base-url rule orders the argument, DFO_BASE_URL and the public default, with 14 vectors replayed by a reference resolver in tests/test_rules.py.
This branch has not been deployed
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 DFO clients are about to rely on three behaviours that the contract did not state, so this writes them down before the clients depend on them.
python/client-contract/README.mdnow says that a POST for a build identical to one that is pending or running returns that same operation, because dfo-apis derives the operation id from the request (src/datasets_api/operation_store.pycompute_operation_idhashes the request identity, the origin catalogue build id and the rendering). A client that stops waiting can post the same build again to join it. Within one catalogue build the id is stable; a new catalogue build gives a new id.The timeout paragraph replaces
fetch(timeout=1800)with a wait that has no whole-call deadline by default,fetch(timeout=…)as the opt-in bound, and a download stall bound: a download that delivers no byte for 30 s raises the retryablenetwork_error. The per-attempt 30 s bound and every replayed behaviour are unchanged; timeouts are not replayed, so no scenario changes.rules/base-url.jsonadds the base URL rule besidekey-lookup: the argument, thenDFO_BASE_URL, thenhttps://developmentfinance.org/api/v1. An empty variable counts as unset, an empty or malformed argument refuses withbase_url_invalid(already inclient-codes.json), and only the chosen source is checked.rules.schema.json,contract.pyRULES,rules/README.mdand a reference resolver intests/test_rules.pycarry it. The validator does not yet cross-check the rule's error reason againstclient-codes.jsonas it does for key lookup.Testing:
uv run pytest -qinpython/client-contract93 passed;tools/validate_client_contract.pyvalid with 23 client codes and 120 scenarios;tools/tests/test_validate_client_contract.py311 passed; ruff and ty clean. No scenario was re-recorded and no API was called.