Conversation
Contributor
There was a problem hiding this comment.
LGTM. Fix is the right shape — bundle before build at both CI smoke and release plumbing, and warn (not debug) when the SDK pin can't find its own bundle.
Things I checked
_ensure_statediscrimination atsrc/adcp/validation/schema_loader.py:189-197:log_missing = logger.warning if version is None else logger.debugis correct. SDK-pinned miss = packaging bug worth surfacing; explicitversion=miss = caller asked for a bundle we don't ship, stays quiet. Fail-closed beats fail-open here.- One-shot warning behavior.
_state_misses.add(bundle_key)at L196 plus the early returns at L179 and L187 mean the warning fires exactly once per bundle_key per process. No log spam in long-lived workers. - Both new tests at
tests/test_schema_loader_per_version.py:194-223wrap in_reset_for_tests()before and after, so_state_missesis clean across the assertion window. The monkeypatch on_resolve_schema_rootexercises the branch as intended. - Workflow gating in
.github/workflows/release-please.yml:98-100: samerelease_created || workflow_dispatch+publishcondition as the existing build step. Symmetric. - CI smoke build at
.github/workflows/ci.yml:171-175now bundles beforepython -m build --wheel, so the smoke wheel matches the release wheel shape. The validation gap that hid #897 is closed. - No public-API drift.
schema_loaderis reachable fromadcp.validation, but the change is logger-level only.
Follow-ups (non-blocking — file as issues)
- Wheel-content assertion in CI. Three lines (
python -m zipfile -l dist/*.whl | grep -q 'adcp/_schemas/.*\.json') on the smoke job would have caught #897 the first time, and is cheap insurance against any future regression inbundle_schemas.py,package-dataglobs, or workflow ordering. Notable that a PR landing schema-bundling into CI doesn't also assert the schemas ended up in the wheel. - Move bundling into the build backend. Anyone running
python -m buildoutside this workflow — local release, downstream rebuild,uv build, vendor repackaging — reproduces #897. Asetuptoolsbuild_pysubclass or an in-tree PEP 517 backend wrapper would make the wheel correct by construction. The current CI-step approach is a workaround at the wrong layer. warnings.warnvslogging.warningfor the implicit-bundle miss.logger.warningis invisible to adopters who haven't configured theadcp.validationlogger — the common case on a first-touch broken install. A once-per-processwarnings.warnwould surface in pytest and most app harnesses without logger config. Not blocking —warningis a strict improvement overdebugeither way.
Minor nits (non-blocking)
- Negative test could be tighter.
tests/test_schema_loader_per_version.py:215-223asserts the specific string isn't incaplog.records. Assertingnot any(r.levelno >= logging.WARNING for r in caplog.records)would also catch a regression that emits a different message at warning level on the explicit-version path.
Approving on the strength of the gating-condition symmetry plus the one-shot-warning behavior.
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
adcp/_schemasversion=misses quietFixes #897
Validation
uv run --extra dev --group dev pytest tests/test_schema_loader_per_version.py tests/test_legacy_schema_bundle_v2_5.py tests/test_schema_validation.py tests/test_validation_version.pyuv run --extra dev --group dev pytest tests/ -v --cov=src/adcp --cov-report=term-missinguv run --extra dev --group dev ruff check src/ tests/test_schema_loader_per_version.pyuv run --extra dev --group dev mypy src/adcp/uv run --extra dev --group dev mypy --strict tests/type_checks/uv run --extra dev --group dev python scripts/check_type_ignore_contract.pyuv run --extra dev --group dev python scripts/bundle_schemas.py && uv run --extra dev --group dev --with build python -m build --wheel --outdir dist/adcp/_schemas/*.jsonentries