Conversation
There was a problem hiding this comment.
Pull request overview
Adds an AsyncHTTPClient-compatible integration for Replay by introducing a lightweight HTTPClientProtocol abstraction and a ReplayHTTPClient implementation that can replay from HAR/stubs and optionally passthrough/record via a live HTTPClient.
Changes:
- Introduce
HTTPClientProtocol+ReplayHTTPClient(AsyncHTTPClient trait-gated) and conversion helpers betweenHTTPClientRequest/HAR/URLRequest. - Extend
PlaybackStorewithrecordEntry(_:)to support recording from non-URLSessionclients. - Add AsyncHTTPClient-focused documentation and CI/SwiftPM trait wiring (plus tests).
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
Sources/Replay/Replay+HTTPClient.swift |
Adds HTTPClientProtocol, ReplayHTTPClient, and conversion/recording glue for AsyncHTTPClient. |
Sources/Replay/Playback.swift |
Exposes configuration internally and adds recordEntry(_:) for recording pre-built HAR entries. |
Tests/ReplayTests/ReplayHTTPClientTests.swift |
Adds tests for stub/entry replay and conversion helpers under canImport(AsyncHTTPClient). |
README.md |
Documents enabling the AsyncHTTPClient trait and using HTTPClientProtocol/ReplayHTTPClient. |
Package.swift |
Adds AsyncHTTPClient trait and conditional product dependency on AsyncHTTPClient. |
Package.resolved |
Locks new transitive dependencies from async-http-client. |
.github/workflows/ci.yml |
Updates CI build/test commands to enable the AsyncHTTPClient trait. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Resolves #9