feat(adcp): support ADCP_BASE_URL env override in sync_schemas.py#285
Draft
feat(adcp): support ADCP_BASE_URL env override in sync_schemas.py#285
Conversation
Matches the JS SDK pattern so cross-SDK CI can set ADCP_BASE_URL once to point both clients at a fixture CDN or pre-release bundle server. Trailing slashes on the env var value are stripped to prevent a doubled /protocol path segment. Adds a print when the override is active. Closes #284 https://claude.ai/code/session_01KXfYPHYKr3R6EDqUbbo9ty
… ! sigil test_default_value was relying on the already-loaded _mod which bakes in whatever ADCP_BASE_URL was when pytest started — exactly the CI case this feature enables. Switched to the same fresh-module-load pattern the other two env-override tests already use, with monkeypatch.delenv to guarantee the default code path. Also align the override print line with the established ! sigil convention. https://claude.ai/code/session_01KXfYPHYKr3R6EDqUbbo9ty
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.
Closes #284
Summary
Adds
ADCP_BASE_URLenv var support toscripts/sync_schemas.py, matching the JS SDK (@adcp/client/scripts/sync-schemas.ts:23). Cross-SDK CI can now set the var once to point both clients at a fixture CDN or pre-release bundle server, without editing source._ADCP_BASE = os.environ.get("ADCP_BASE_URL", "https://adcontextprotocol.org").rstrip("/")— default unchanged; trailing slashes stripped to prevent a doubled/protocolpath segment that would silently 404BUNDLE_BASE_URL = _ADCP_BASE + "/protocol"— all three fetch sites (fetch_bundle,fetch_signature_sidecars) pick up the override automatically! ADCP_BASE_URL override active: <base>when the override is active, before the fetch banner, using the established!sigil conventionADCP_BASE_URLandADCP_SKIP_SIGNATUREenv vars together for discoverabilitymonkeypatch+ fresh module load so the test is correct even whenADCP_BASE_URLis set in the environment when pytest startsWhat was tested
pytest tests/test_sync_schemas.py— 18 passedpytest tests/ --ignore=tests/integration --ignore=tests/conformance/signing/test_ip_pinned_transport.py— 2180 passed, 21 skippedPre-PR review
test_default_value) fixed; nits noted belowNits surfaced (not fixed — reviewer discretion)
ADCP_BASE_URLincludes the/protocolsuffix (e.g.https://fixture.example.com/protocol→ doubled path, silent 404). The docstring warns against it; aValueErrorguard would be stronger.urlopenacceptsfile://URIs viaADCP_BASE_URL; acceptable for a dev tool given the SHA-256 + Sigstore chain validates integrity, but worth noting.sync_schemas_fresh,sync_schemas_fresh2) use a numeric suffix;request.node.name-derived names would be cleaner but not necessary.Session: https://claude.ai/code/session_01KXfYPHYKr3R6EDqUbbo9ty
Generated by Claude Code