Migrate provider HTTP stack to httpware 0.8#2
Merged
Conversation
Port semvertag's provider HTTP stack onto httpware 0.8+: delete RetryingTransport + HttpClient wrapper, hold httpware.Client directly in GitLabProvider, translate StatusError subclasses into semvertag's operator-action error tree via a small providers/_errors.py module. Intentional behavior changes (POST not retried, snappier backoff, RetryBudget over wall-clock cap) listed as improvements over today. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Six-task plan derived from the 2026-06-07-httpware-migration design spec. Order: add dep, TDD the translation module, port gitlab.py + integration tests, switch ioc.py wiring, delete _transport/_http and their tests, final validation. Resolves the spec's four open items (DI seam split, request_timeout type, __main__ catch posture, pagination call-site shape). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bumps requires-python to >=3.11 (httpware 0.8 floor) and drops the Python 3.10 classifier accordingly. Pre-1.0 breaking change for any 3.10-pinned consumer; aligns semvertag with httpware. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
httpware 0.8.0 floors at Python 3.11, so Task 1 must also bump requires-python and drop the 3.10 classifier. The work was already done in 23de656; this updates the plan to match. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…cerns Rewrites GitLabProvider to hold httpware.Client directly, replacing _url()/_translate_status()/gitlab_auth_headers() with translate_gitlab() from _errors; adds _validate_project_response() for consistent decoding. Updates integration tests and conftest to use the new seam; updates ioc.py minimally to wire httpx2.Client+httpware.Client (Task 4 will refine). Deleted test functions: - test_translate_status_raises_provider_api_error_for_unknown_status Renamed (behavior updated) test functions: - test_raises_provider_api_error_on_5xx_after_retries_exhausted → test_raises_provider_api_error_on_5xx (no RetryingTransport; same error message via translate_gitlab) - test_raises_provider_api_error_on_429_after_retries_exhausted → test_raises_provider_api_error_on_429 (same) - test_raises_provider_api_error_when_request_error_chained_from_exc → test_raises_provider_api_error_when_network_error (match updated to "GitLab unreachable"; __cause__ is now httpware.NetworkError) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…egration README Final-review follow-ups: CI matrix and ReadTheDocs build still pinned to Python 3.10 after the pyproject bump; integration README still described the deleted RetryingTransport monkeypatch seam. Aligns everything to the new httpware-backed stack. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Ports the GitLab provider's HTTP stack off the hand-rolled
RetryingTransport+HttpClientwrapper onto thehttpware0.8 framework.GitLabProvider.httpnow holds anhttpware.Clientdirectly; methods catchhttpware.ClientErrorand translate via a new per-provider_errors.translate_gitlab(...)into the existing operator-action error tree (ConfigError/2,AuthError/3,ProviderAPIError/4)._transport.py(RetryingTransport),providers/_http.py(HttpClient), and their dedicated unit tests (test_transport_retry.py,test_http_client.py) are deleted — that contract now lives inhttpware.Retry. Net ~600 lines of HTTP plumbing removed.ioc.pybuildshttpware.Clientwith one configured knob —Retry(retry_status_codes={408, 429, 500, 502, 503, 504})— and accepts httpware defaults for everything else (snappier backoff, POST not retried,RetryBudgetover per-request wall cap,Retry-Afterhonored verbatim). All deliberate, all called out in the spec.requires-python = ">=3.11,<4") to match httpware's floor; CI matrix and.readthedocs.yamlupdated to match.Design spec:
planning/specs/2026-06-07-httpware-migration-design.mdImplementation plan:
planning/plans/2026-06-07-httpware-migration.mdTest plan
just lint-ci— clean (ruff format + ruff check + ty)just test— 332 passed, 100% statement+branch coveragemkdocs build --strict— cleanhttpware.Client(httpx2_client=httpx2.Client(transport=httpx2.MockTransport(...)))🤖 Generated with Claude Code