Skip to content

fix(signing): use public httpcore2 socket option type - #1916

Open
rachitm022 wants to merge 2 commits into
nextfrom
rmatani/fix-httpcore2-socket-option-import
Open

rachitm022 wants to merge 2 commits into
nextfrom
rmatani/fix-httpcore2-socket-option-import

Conversation

@rachitm022

Copy link
Copy Markdown
Collaborator

Why

httpcore2==2.16.1 moved the SOCKET_OPTION definition out of its private _backends.base module. 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

  • Import the type-only SOCKET_OPTION alias from the public httpcore2 package surface.
  • Preserve compatibility with the supported httpcore2>=2.5.0,<3.0 range.
  • Leave CI configuration and dependency constraints unchanged.

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.py
  • uv run --with httpcore2==2.5.0 mypy src/adcp/signing/ip_pinned_transport.py
  • uv run -m pytest tests/conformance/signing/test_ip_pinned_transport.py -q
  • uvx ruff check src/adcp/signing/ip_pinned_transport.py
  • uvx ruff format --check src/adcp/signing/ip_pinned_transport.py

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant