Skip to content

refactor(request_service): modernize HTTPX transport and purify strategy architecture - #505

Merged
gildesmarais merged 2 commits into
masterfrom
refactor/httpx-transport-modernization
Sep 6, 2026
Merged

gildesmarais merged 2 commits into
masterfrom
refactor/httpx-transport-modernization

Conversation

@gildesmarais

Copy link
Copy Markdown
Member

What changed

  • Drop Faraday remnants and streamline RequestService strategy architecture.
  • Enable native HTTPX plugins (follow_redirects, compression, retries) for transport-level resilience, automatic Brotli/Gzip decompression, and redirect loop enforcement.
  • Eliminate custom transport-level error wrap layers and unify strategy interface on Strategy base with typed domain errors (RequestTimedOut, BlockedSurfaceDetected, PrivateNetworkDenied, BotasaurusConnectionFailed, BotasaurusServiceError).
  • Modernize CompressedBody to handle raw/Botasaurus decompression fallback with unified EncodingError handling.
  • Keep strict 0-legacy posture without backward compatibility shims or dual export names.

Why

Faraday was deprecated and replaced with HTTPX, but legacy indirection, intermediate wrapper layers, and bespoke redirect/compression handlers remained in the codebase. This change cuts all residual complexity, leverages HTTPX's native plugin architecture, and aligns RequestService with modern Ruby patterns.

Risk

  • Low: Public contract of Html2rss.feed, feed_result, and CLI commands remains intact. All 1,871 test suite examples pass with 98.32% line coverage.

Review map

  1. lib/html2rss/request_service/httpx_strategy.rb — Native HTTPX plugins configuration and response building.
  2. lib/html2rss/request_service.rb — Clean strategy registry and error classification.
  3. lib/html2rss/request_service/strategy.rb — Base strategy interface.
  4. lib/html2rss/request_service/compressed_body.rb — Decompression utility.
  5. spec/lib/html2rss/request_service_spec.rb — Updated test suite.

Validation

  • make ready (1,871 examples, 0 failures; RuboCop clean; YARD lint clean; schema & docs verified).

@gildesmarais
gildesmarais merged commit e1d2550 into master Sep 6, 2026
10 checks passed
@gildesmarais
gildesmarais deleted the refactor/httpx-transport-modernization branch September 6, 2026 08:37
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