Repository navigation
fix(signing): use public httpcore2 socket option type - #1916
rachitm022 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean one-line, type-only import fix.
This PR makes a single change in src/adcp/signing/ip_pinned_transport.py:112, moving SOCKET_OPTION2 from the private httpcore2._backends.base import to the public top-level httpcore2 import. The symbol is used only in TYPE_CHECKING-guarded annotations (L257, L280), so there is no runtime impact, no wire-shape change, and no change to the adcp.* public surface. The runtime private-backend canary imports (L102–105) are untouched, and the change was verified at both ends of the supported httpcore2>=2.5.0,<3.0 range. The fix: conventional-commit prefix is appropriate.
Decision-table walkthrough: no critical/high findings (row 1 n/a); gated_paths is false (row 2 n/a); high_risk reason is (modified) not (deleted) (row 3 n/a); no medium findings at all so rows 4, 5, and 8 don't fire; no prior decision (row 6 n/a); no no-auto-approve team match (row 7 n/a). The high_risk flag is a heuristic signal only — a (modified) sensitive file with zero medium-or-higher findings is presumed safe. Falls through to row 9: approve.
There was a problem hiding this comment.
Ladon verdict: Approve
Approve.
Subsequent pass with a single test-only delta in tests/conformance/signing/test_ip_pinned_transport.py (L99-104). The change loosens the httpcore2-vs-httpcore contract test from a full inspect.signature equality check to a per-parameter (name, kind, default) structural comparison. This is sound: Signature.__eq__ also compares annotations, which can legitimately diverge between httpcore generations while the keyword-forwarding override stays call-compatible. The new check is strictly looser, preserves parameter ordering, and still covers both the sync and async backends.
high_risk is true only because src/adcp/signing/** matches a high-risk glob (modified), but the reviewer surfaced no medium-or-higher findings, so the modification is presumed safe (no deletion, no sensitive-category finding). No semver/public-surface impact, no forward-compat or codegen concern, CI gates remain armed. gated_paths is false and review_decision is APPROVED.
No critical/high/medium findings. Rows 1-8 do not fire → row 9 approve. Prior approve stands.
Why
httpcore2==2.16.1moved theSOCKET_OPTIONdefinition out of its private_backends.basemodule. The symbol remains part of the package's documented top-level exports, but mypy rejects the private re-export and blocks CI for unrelated PRs.What changed
SOCKET_OPTIONalias from the publichttpcore2package surface.httpcore2>=2.5.0,<3.0range.Verification
uv run --with httpcore2==2.16.1 mypy src/adcp/ packages/adcp-reporting-storage/src/adcp_reporting_storage/uv run --with httpcore2==2.16.1 mypy --strict tests/type_checks/ examples/reporting_webhook_activity.py examples/reporting_status_notifications.py examples/reporting_destination_writer.py examples/reporting_durable_materializer.py examples/reporting_receipt_ingress.py examples/reporting_production.pyuv run --with httpcore2==2.5.0 mypy src/adcp/signing/ip_pinned_transport.pyuv run -m pytest tests/conformance/signing/test_ip_pinned_transport.py -quvx ruff check src/adcp/signing/ip_pinned_transport.pyuvx ruff format --check src/adcp/signing/ip_pinned_transport.py