Repository navigation
feat(client-contract): add the ref_digest_changed client warning - #18
Merged
Merged
Conversation
A ref names one rendering's digest. When the server renders the same content_version again, the file a client downloads hashes differently, and the client returns the data. warning-codes.json gains ref_digest_changed, a DfoWarning, so both clients issue that warning with a code the contract lists, and the validator requires the row.
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.
A
DatasetRefrecords the digest of one rendering of acontent_version. When the server renders that version again, a client fetching the ref downloads a file with another digest. The SDK clients now return the data and warn, naming both digests, butwarning-codes.jsonheld no code for a warning a client issues itself in that case, andDataWarningwithdigest_mismatchwould have mixed a server manifest warning with the ServerError for a download that fails its hash.warning-codes.jsongainsref_digest_changed, classDfoWarning, sorted beforeroute_deprecated.tools/validate_client_contract.pyadds it to the codes the client rules issue, so_check_warning_codesrequires the row, andtools/tests/test_validate_client_contract.pygains a row that drops it and expects the missing-row problem. The README's warning-code sentence and the CHANGELOG name it, and the CHANGELOG count moves from five codes to six. No recorded scenario issues the warning yet.Testing:
uv run tools/validate_client_contract.pyprintedclient contract valid: 101 action rows, 23 client codes, 29 required and 8 enum pointers, 118 scenarios.pytest tools/testspassed 518 tests; inpython/client-contract,pytestpassed 78, andruff check,ruff format --checkandty checkpassed.