refactor(request_service): modernize HTTPX transport and purify strategy architecture - #505
Merged
Merged
Conversation
…d migrate specs to default
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.
What changed
RequestServicestrategy architecture.follow_redirects,compression,retries) for transport-level resilience, automatic Brotli/Gzip decompression, and redirect loop enforcement.Strategybase with typed domain errors (RequestTimedOut,BlockedSurfaceDetected,PrivateNetworkDenied,BotasaurusConnectionFailed,BotasaurusServiceError).CompressedBodyto handle raw/Botasaurus decompression fallback with unifiedEncodingErrorhandling.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
RequestServicewith modern Ruby patterns.Risk
Html2rss.feed,feed_result, and CLI commands remains intact. All 1,871 test suite examples pass with 98.32% line coverage.Review map
lib/html2rss/request_service/httpx_strategy.rb— Native HTTPX plugins configuration and response building.lib/html2rss/request_service.rb— Clean strategy registry and error classification.lib/html2rss/request_service/strategy.rb— Base strategy interface.lib/html2rss/request_service/compressed_body.rb— Decompression utility.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).