feat: adopt pact_ffi 0.5.4 based PactSwiftMockServer#134
Open
pepejeria wants to merge 1 commit into
Open
Conversation
Prepares PactSwift for the pact_ffi 0.5.4 based PactSwiftMockServer. Source changes only; the Package.swift repoint waits on a 0.5.4 XCFramework release, so the branch does not build until that dependency is updated. Provider verifier: - Replace the newline-delimited `args` string with a typed mapping from ProviderVerifier.Options to PactSwiftMockServer.VerificationOptions. - Update the ProviderVerifier call site and the MockVerifier test double for the new verifyProvider(options: VerificationOptions) signature. - Known gaps (documented in code): multiple filter states/descriptions collapse to the first (FFI takes one each), and logLevel is not mapped (no per-verifier FFI setter). WIP provider version is not forwarded outside publishing. Consumer-side API drift (fork -> surpher): - BodyBuilder.body contentType is now non-optional. - Drop the redundant HeaderBuilder.header(_:value:) extension; surpher provides it. - Pact.version is now the instance property ffi_version. Rewrite ProviderVerifier+OptionsTests to assert the mapped VerificationOptions. Verified locally against a macOS xcframework built from real pact_ffi 0.5.4: 201/203 tests pass. The 2 failures are pact_ffi 0.5.4 engine behaviour changes, not this change: multi-value request headers, and an empty response body no longer emitting a Content-Type header.
surpher
approved these changes
Jul 22, 2026
surpher
left a comment
Owner
There was a problem hiding this comment.
Love your work! Thank you.
I'll get the new version of PactSwiftMockServer and XCFramework out in the next couple of days. And we go from there. 🫡
Owner
|
Released @pepejeria carry on 🫡 |
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.
Updates PactSwift to use the new pact_ffi 0.5.4 based PactSwiftMockServer.
📝 Summary of Changes
VerificationOptionsAPI.Note: This PR does not change
Package.swift. It still points at the ittybittyapps fork, so this branch will not build until the dependency is repointed. That repoint needs a 0.5.4 XCFramework release to exist first.@surpher, could you release a 0.5.4 release of PactSwiftMockServer (the merged
chore/update-libpact_ffi-0.5.x)? That creates the 0.5.4 xcframework binary. Once it's published I'll updatePackage.swiftto point to it.Known mapping gaps (the new FFI is a bit less flexible than the old CLI string, all noted in code):
logLevelis not applied (the new verifier API has no per run log level).🧐🗒 Reviewer Notes
💁 Example
The public
ProviderVerifier.OptionsAPI is unchanged, so existing usage stays the same. The change is internal, the options are now mapped to the mock server's typedVerificationOptionsinstead of a CLI args string.🔨 How To Test
Not testable in CI until Package.swift is repointed. Verified locally by building a macOS xcframework from the 0.5.4 branch and pointing this branch at it: 201/203 pass. The 2 failures are pact_ffi 0.5.4 behaviour changes, not this PR.