Skip to content

Migrate provider HTTP stack to httpware 0.8#2

Merged
lesnik512 merged 9 commits into
mainfrom
feat/httpware-migration
Jun 7, 2026
Merged

Migrate provider HTTP stack to httpware 0.8#2
lesnik512 merged 9 commits into
mainfrom
feat/httpware-migration

Conversation

@lesnik512

@lesnik512 lesnik512 commented Jun 7, 2026

Copy link
Copy Markdown
Member

Summary

Ports the GitLab provider's HTTP stack off the hand-rolled RetryingTransport + HttpClient wrapper onto the httpware 0.8 framework.

  • GitLabProvider.http now holds an httpware.Client directly; methods catch httpware.ClientError and 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 in httpware.Retry. Net ~600 lines of HTTP plumbing removed.
  • ioc.py builds httpware.Client with 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, RetryBudget over per-request wall cap, Retry-After honored verbatim). All deliberate, all called out in the spec.
  • Drops Python 3.10 support (requires-python = ">=3.11,<4") to match httpware's floor; CI matrix and .readthedocs.yaml updated to match.

Design spec: planning/specs/2026-06-07-httpware-migration-design.md
Implementation plan: planning/plans/2026-06-07-httpware-migration.md

Test plan

  • just lint-ci — clean (ruff format + ruff check + ty)
  • just test — 332 passed, 100% statement+branch coverage
  • mkdocs build --strict — clean
  • Integration tests exercise the new seam end-to-end via httpware.Client(httpx2_client=httpx2.Client(transport=httpx2.MockTransport(...)))
  • CI matrix runs across Python 3.11–3.14
  • Optional: smoke against a real GitLab project before merging

🤖 Generated with Claude Code

lesnik512 and others added 9 commits June 7, 2026 21:06
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>
@lesnik512 lesnik512 self-assigned this Jun 7, 2026
@lesnik512 lesnik512 merged commit cdff5b9 into main Jun 7, 2026
5 checks passed
@lesnik512 lesnik512 deleted the feat/httpware-migration branch June 7, 2026 20:01
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