Repository navigation
#420 feat: adopt notifier-client v0.4.0; the whole process moves to httpx2 - #424
Merged
Merged
Conversation
… httpx2 notifier-client 0.4.0 re-raises httpx2's exceptions, so the `except httpx.HTTPError` clauses in notify_unit_failure.py and archive_age_check.py stopped matching: an unreachable notifier fell through to the last-resort handler and was logged as "unexpected". - Every httpx site moves to httpx2 (registry, usps/google clients, _rate_limit, libpostal_client, the four infra scripts); httpx and httpcore leave uv.lock. - PII-guard logger pins move to httpx2/httpcore2, the names httpx2 logs on (libpostal and USPS both GET with the address in the query). - httpx2 defaults to the OS trust store; every client passes verify=trusted(), a certifi-only context (core/tls.py, and infra/tls.py for scripts with no PYTHONPATH). certifi declared. - Guards: tests/ci/test_http_stack.py (AST walk + fresh interpreter), tests/ci/test_trust_store.py (certifi roots, hostname checks, every call site). Fail-open tests now assert which branch they hit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- LOGGING.md: pinned rows on httpx2/httpcore2; USPS's address call is a GET with the address in the query string, not a POST. - SENSITIVE-AREAS(-INFRA).md: logging and libpostal rows, rows for core/tls.py, infra/tls.py and the SDK except clauses. - ARCHITECTURE.md, VALIDATION-PROVIDERS.md, README.md, CHANGELOG.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 17, 2026
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 #420
Adopts notifier-client v0.4.0 (
bcf042eb). Following the coordinator's brief and co-status's precedent (CannObserv/status#125, PR CannObserv/status#126), the whole process moves from httpx to httpx2.httpxandhttpcoreleaveuv.lock, and no alias is needed: there is no respx here (brief §1).Red first
1. SDK bumped only, code unchanged (
tool.uv.sources→v0.4.0,notifier-client>=0.4.0,<1). The fakes now raisehttpx2.ConnectError, and each fail-open case asserts which branch it hit:2. Logger pins on the old names. A real httpx2 request under
LOG_LEVEL=DEBUGwrote the address to stdout at INFO:3. Guards, before any site moved:
Green
registry.py,usps_client.py,google_client.py,_rate_limit.py,libpostal_client.py, and ininfra/:notify_unit_failure.py,archive_age_check.py,status_checkin.py,patching_recovery_check.py. All are renames; behaviour is unchanged apart from TLS (below).PINNED_LOGGER_LEVELSandcore/log_config.jsonnow pinhttpx2andhttpcore2, replacing the old names. The old names are dropped: nothing in the process loads httpx, andtest_http_stack.pykeeps it that way.core/tls.trusted(), modeled on status'ssrc/core/tls.py, is a cachedssl.create_default_context(cafile=certifi.where()). All 4 client sites passverify=trusted(), the plain-http ones too: registry (USPS + Google), libpostal, status_checkin, patching_recovery_check.httpx2>=2.16.2,<3,certifi>=2026.10.19,<2027(now explicit),notifier-client>=0.4.0,<1.httpxis removed from runtime and dev.tests/ci/test_http_stack.pyandtests/ci/test_trust_store.py.src/ infra/ scripts/ alembic/, plus a fresh interpreter importing everysrcandinframodule. That includesnotifier_client, and the test asserts it was imported.trusted()copies hold exactly certifi's roots and check hostnames; everyhttpx2.<call>site passesverify=trusted(), imported from a tls module; floor ≥ 4; nofrom httpx2 import Client.MockTransport,AsyncMock(spec=httpx2.AsyncClient),MagicMock(spec=httpx2.Response), and the exception fakes. The 13TestClientfiles needed no change: Starlette now picks httpx2, and its "Usinghttpx… is deprecated" warning is gone from the run (3 → 2 warnings).uv.lockdeltaverify=trusted())sys_platform == 'emscripten'only; not installed)8e7c020b)bcf042eb)No dependency still needs httpx, so CannObserv/status#127's alias fallback isn't needed.
Tests
a758d08d8bc2f1About the coverage range: the files this PR touches miss the same lines as on main, shifted by the inserted lines. The ±1-line wobble is
routers/admin/queries/dashboard.py:81, areturninside a gathered coroutine. It's timing-dependent and untouched here: one branch run on identical code scored 96.44%.Also passing:
uv run pre-commit run --all-files,bash scripts/pre-ship.sh(2830 passed, 5 skipped, 86 deselected, plus JS 8/8),uv audit --frozen(no known vulnerabilities, 85 packages),uv lock --check.Found beyond the brief
test_main_fails_openasserted only "the journal line stands", which both the expected and the unexpected branch log. Swapping the fake tohttpx2.ConnectErroralone would have stayed green. Each case now asserts whether "failed unexpectedly" appears."ConnectError" in caplog.text, and the unexpected path's traceback contains that string too. Both now also assertunexpectedlyis absent. They are the only tests that drive the real 0.4.0 SDK, and they went red in step 1.infra/tls.py, a twin ofcore/tls.py. The patching knob runsinfra/patching_recovery_check.pywith no PYTHONPATH (.skills/patching-hosts), so it can't importaddress_validator. The infra scripts taketrusted()from a sibling module, as they already dojournal_logging. The trust-store test parametrizes over both and requires each call site to importtrustedfrom one of the two.SSL_CERT_FILEno longer applies to our clients (an explicit context overrides it). No unit sets it, and the prod env file has noSSL_CERTkey (checked by count, not printed).:126: the USPS token call is the otherPOST. That body carries the client secret, which httpx2 doesn't log either.Docs
LOGGING.md(pinned rows,httpx2.RequestError, the USPSGETcorrection),SENSITIVE-AREAS.md(logging, libpostal and chain-provider rows; newcore/tls.pyrow),SENSITIVE-AREAS-INFRA.md(SDK except clauses,infra/tls.py),ARCHITECTURE.md:78+core/tls.py,VALIDATION-PROVIDERS.md:270,README.md,CHANGELOG.md.DEPENDENCY-POLICY.mdhas no per-package table, so it has no rows to add. NoPIPELINE_CODE_VERSIONbump;models.pyandopenapi.jsonare unchanged.Deploy (not done; needs approval)
A runtime change: in the main checkout,
uv syncand thensudo systemctl restart address-validator, outside the patching quiet ranges. Verify per brief §7: health 200, nohttpx2/httpcore2INFO record in the journal since the restart, and one real USPS/api/v2/validateover the certifi context. The first runs ofarchive-age-check,unit-failure@and the backup'sstatus_checkinon 0.4.0 remain verification debt.🤖 Generated with Claude Code