From a9b2c69bb26e875e132e2ba5cc9c402cc882547f Mon Sep 17 00:00:00 2001 From: ChangkeunJ Date: Mon, 26 Oct 2026 18:43:40 +0900 Subject: [PATCH 01/12] fix(pact_verifier): apply generators to form-urlencoded request bodies pact_verifier builds pact_matching with default-features = false and never enabled form_urlencoded, so apply_body_generators took the #[cfg(not(feature = "form_urlencoded"))] branch and sent form bodies to the provider as recorded. Add a form_urlencoded feature to pact_verifier, put it in the defaults and pass it through from pact_verifier_cli, with a test that runs generate_request over the form request from the issue. Closes #588 --- rust/pact_verifier/Cargo.toml | 3 ++- rust/pact_verifier/src/tests.rs | 37 +++++++++++++++++++++++++++++++ rust/pact_verifier_cli/Cargo.toml | 3 ++- 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/rust/pact_verifier/Cargo.toml b/rust/pact_verifier/Cargo.toml index c3285890d..fd3ccd927 100644 --- a/rust/pact_verifier/Cargo.toml +++ b/rust/pact_verifier/Cargo.toml @@ -15,11 +15,12 @@ exclude = [ ] [features] -default = ["datetime", "xml", "plugins", "multipart"] +default = ["datetime", "xml", "plugins", "multipart", "form_urlencoded"] datetime = ["pact_models/datetime", "pact-plugin-driver?/datetime", "pact_matching/datetime"] # Support for date/time matchers and expressions xml = ["pact_models/xml", "pact-plugin-driver?/xml", "pact_matching/xml"] # support for matching XML documents plugins = ["dep:pact-plugin-driver", "dep:uuid", "pact_matching/plugins", "pact-plugin-driver/default"] multipart = ["pact_matching/multipart"] # suport for MIME multipart bodies +form_urlencoded = ["pact_models/form_urlencoded", "pact_matching/form_urlencoded"] # support for generating form urlencoded bodies [dependencies] ansi_term = "0.12.1" diff --git a/rust/pact_verifier/src/tests.rs b/rust/pact_verifier/src/tests.rs index f520190df..7ea408a06 100644 --- a/rust/pact_verifier/src/tests.rs +++ b/rust/pact_verifier/src/tests.rs @@ -16,12 +16,14 @@ use rstest::rstest; use serde_json::{json, Value}; use pact_consumer::prelude::*; use pact_models::Consumer; +use pact_models::generators::GeneratorTestMode; use pact_models::interaction::Interaction; use pact_models::pact::Pact; use pact_models::prelude::v4::SynchronousHttp; use pact_models::provider_states::*; use pact_models::sync_interaction::RequestResponseInteraction; use pact_models::sync_pact::RequestResponsePact; +use pact_models::v4::http_parts::HttpRequest; use crate::{ FilterById, @@ -1256,3 +1258,38 @@ fn process_comments_with_no_references_produces_no_references_section() { super::process_comments(&interaction, &mut output); assert_snapshot!(output.join("\n")); } + +#[test_log::test(tokio::test)] +async fn generate_request_applies_body_generators_to_a_form_urlencoded_request() { + let request = HttpRequest::from_json(&json!({ + "method": "POST", + "path": "/orders", + "headers": { "Content-Type": "application/x-www-form-urlencoded" }, + "body": { + "content": "customer=1&qty=2¬e=gift+wrap", + "contentType": "application/x-www-form-urlencoded", + "encoded": false + }, + "generators": { + "body": { + "$.customer": { "type": "ProviderState", "expression": "${customer}", "dataType": "STRING" }, + "$.qty": { "type": "RandomInt", "min": 100, "max": 999 } + } + } + })).unwrap(); + let context = hashmap!{ "customer" => json!(1234) }; + + let generated = pact_matching::generate_request(&request, &GeneratorTestMode::Provider, &context).await; + + let body = String::from_utf8(generated.body.value().unwrap().to_vec()).unwrap(); + let params: Vec<(&str, &str)> = body.split('&') + .map(|param| param.split_once('=').unwrap()) + .collect(); + expect!(params.len()).to(be_equal_to(3)); + expect!(params[0]).to(be_equal_to(("customer", "1234"))); + expect!(params[1].0).to(be_equal_to("qty")); + let qty: i32 = params[1].1.parse().unwrap(); + expect!(qty).to(be_greater_or_equal_to(100)); + expect!(qty).to(be_less_or_equal_to(999)); + expect!(params[2]).to(be_equal_to(("note", "gift+wrap"))); +} diff --git a/rust/pact_verifier_cli/Cargo.toml b/rust/pact_verifier_cli/Cargo.toml index 9c95ed3c2..35e058880 100644 --- a/rust/pact_verifier_cli/Cargo.toml +++ b/rust/pact_verifier_cli/Cargo.toml @@ -14,11 +14,12 @@ exclude = [ ] [features] -default = ["datetime", "xml", "plugins", "multipart", "junit"] +default = ["datetime", "xml", "plugins", "multipart", "form_urlencoded", "junit"] datetime = ["pact_models/datetime", "pact_verifier/datetime"] # Support for date/time matchers and expressions xml = ["pact_models/xml", "pact_verifier/xml"] # support for matching XML documents plugins = ["pact_verifier/plugins"] multipart = ["pact_verifier/multipart"] # support for MIME multipart bodies +form_urlencoded = ["pact_models/form_urlencoded", "pact_verifier/form_urlencoded"] # support for form urlencoded bodies junit = ["dep:junit-report", "dep:strip-ansi-escapes"] # support for Junit format reports [dependencies] From 30736ddd38b9afea7098c4af61465240d0615a73 Mon Sep 17 00:00:00 2001 From: "pact-foundation[bot]" <289648111+pact-foundation[bot]@users.noreply.github.com> Date: Thu, 12 Nov 2026 17:49:05 +0000 Subject: [PATCH 02/12] chore(pact_matching): release v2.2.0 --- rust/Cargo.lock | 24 +++++++++--------- rust/pact_consumer/Cargo.toml | 2 +- rust/pact_ffi/Cargo.toml | 2 +- rust/pact_matching/CHANGELOG.md | 42 +++++++++++++++++++++++++++++++ rust/pact_matching/Cargo.toml | 2 +- rust/pact_verifier/Cargo.toml | 2 +- rust/pact_verifier_cli/Cargo.toml | 2 +- 7 files changed, 59 insertions(+), 17 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index a86bcedc0..40b293101 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -130,7 +130,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -141,7 +141,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -1106,7 +1106,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -2452,7 +2452,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -2827,7 +2827,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -2965,7 +2965,7 @@ dependencies = [ [[package]] name = "pact_matching" -version = "2.1.0" +version = "2.2.0" dependencies = [ "ansi_term", "anyhow", @@ -4050,7 +4050,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -4116,7 +4116,7 @@ dependencies = [ "security-framework", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -4510,7 +4510,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -4557,7 +4557,7 @@ dependencies = [ "cfg-if", "libc", "psm", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -4744,7 +4744,7 @@ dependencies = [ "getrandom 0.4.3", "once_cell", "rustix", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -5550,7 +5550,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] diff --git a/rust/pact_consumer/Cargo.toml b/rust/pact_consumer/Cargo.toml index 3d8853bde..2d18cb04e 100644 --- a/rust/pact_consumer/Cargo.toml +++ b/rust/pact_consumer/Cargo.toml @@ -28,7 +28,7 @@ async-trait = "0.1.91" bytes = "1.12.1" itertools = "0.15.0" maplit = "1.0.2" -pact_matching = { version = "2.1.0", path = "../pact_matching", default-features = false } +pact_matching = { version = "2.2.0", path = "../pact_matching", default-features = false } pact_mock_server = { version = "2.2.6", default-features = false } pact_models = { version = "1.3.16", default-features = false } pact-plugin-driver = { version = "1.2.3", optional = true, default-features = false } diff --git a/rust/pact_ffi/Cargo.toml b/rust/pact_ffi/Cargo.toml index cd4e9a8b3..40665190e 100644 --- a/rust/pact_ffi/Cargo.toml +++ b/rust/pact_ffi/Cargo.toml @@ -29,7 +29,7 @@ multipart-2021 = { version = "0.19.0", default-features = false, features = ["cl onig = { version = "6.5.3", default-features = false } # FFI Inmemory sink uses the global static `LOG_BUFFER` in the pact_matching crate. This is required to be the same # version as the mock server crate -pact_matching = { version = "2.1.0", path = "../pact_matching" } +pact_matching = { version = "2.2.0", path = "../pact_matching" } pact_mock_server = "2.2.6" pact_models = { version = "1.3.16" } pact-plugin-driver = { version = "1.2.3" } diff --git a/rust/pact_matching/CHANGELOG.md b/rust/pact_matching/CHANGELOG.md index 7c4db3784..aadbdb201 100644 --- a/rust/pact_matching/CHANGELOG.md +++ b/rust/pact_matching/CHANGELOG.md @@ -1,5 +1,47 @@ # Changelog +## [2.2.0](https://github.com/pact-foundation/pact-reference/compare/pact_matching-v2.1.0...pact_matching-v2.2.0) - _2026-11-12_ + +### ๐Ÿš€ Features + +- _(matching)_ Respect Link and Via grammars when splitting headers + +### ๐Ÿ› Bug Fixes + +- Apply the matchers nested under an eachValue matcher + +- Apply an eachValue rule once when the values already have it + +- _(pact_matching)_ Merge the eachValue rules into any existing rules for the values + +- _(v2 engine)_ Apply the rules defined below an eachValue matcher to its values + +- _(matching)_ Match combined headers against repeated expectations + +- _(matching)_ Normalize repeated custom headers across engines + +- _(matching)_ Classify headers once for both engines + +- _(matching)_ Compare repeated custom headers by their joined value + +- _(matching)_ Apply scalar header matchers to the joined value + +- _(matching)_ Split repeated headers into list elements for list matchers + +- _(matching)_ Normalise repeated headers using the header's own grammar + +- _(matching)_ Use the header grammar when comparing single header values + +- _(matching)_ Name the failing value when a repeated header fails a scalar rule + +### ๐Ÿ“š Documentation + +- _(matching)_ Describe repeated header matching + +### ๐Ÿงช Testing + +- _(matching)_ Keep separate-line header list cases beside combined ones + ## [2.1.0](https://github.com/pact-foundation/pact-reference/compare/pact_matching-v2.0.11...pact_matching-v2.1.0) - _2026-10-21_ ### ๐Ÿš€ Features diff --git a/rust/pact_matching/Cargo.toml b/rust/pact_matching/Cargo.toml index d6342f83d..64825f162 100644 --- a/rust/pact_matching/Cargo.toml +++ b/rust/pact_matching/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pact_matching" -version = "2.1.0" +version = "2.2.0" authors = ["Ronald Holshausen "] edition = "2024" description = "Pact-Rust support library that implements request and response matching logic" diff --git a/rust/pact_verifier/Cargo.toml b/rust/pact_verifier/Cargo.toml index fd3ccd927..2cece427a 100644 --- a/rust/pact_verifier/Cargo.toml +++ b/rust/pact_verifier/Cargo.toml @@ -36,7 +36,7 @@ itertools = "0.15.0" lazy_static = "1.5.0" maplit = "1.0.2" mime = "0.3.17" -pact_matching = { version = "2.1.0", path = "../pact_matching", default-features = false } +pact_matching = { version = "2.2.0", path = "../pact_matching", default-features = false } pact_models = { version = "1.3.16", default-features = false } pact-plugin-driver = { version = "1.2.3", optional = true, default-features = false } uuid = { version = "1.24.0", features = ["v4"], optional = true } diff --git a/rust/pact_verifier_cli/Cargo.toml b/rust/pact_verifier_cli/Cargo.toml index 35e058880..55f3d3cfa 100644 --- a/rust/pact_verifier_cli/Cargo.toml +++ b/rust/pact_verifier_cli/Cargo.toml @@ -30,7 +30,7 @@ junit-report = { version = "0.8.3", optional = true } lazy_static = "1.5.0" log = "0.4.27" maplit = "1.0.2" -pact_matching = { version = "2.1.0", path = "../pact_matching", default-features = false } +pact_matching = { version = "2.2.0", path = "../pact_matching", default-features = false } pact_models = { version = "1.3.16", default-features = false } pact_verifier = { version = "1.5.0", path = "../pact_verifier", default-features = false } quick-xml = { version = "0.39.2", features = ["serde", "serialize"] } From e28d513c840e8d40e1b069e00f3b0f8a293dc53b Mon Sep 17 00:00:00 2001 From: "pact-foundation[bot]" <289648111+pact-foundation[bot]@users.noreply.github.com> Date: Fri, 13 Nov 2026 10:43:27 +0000 Subject: [PATCH 03/12] chore(pact_models): release v1.3.18 --- rust/Cargo.lock | 24 ++++++++++++------------ rust/pact_models/CHANGELOG.md | 6 ++++++ rust/pact_models/Cargo.toml | 2 +- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 40b293101..5a9aa643f 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -130,7 +130,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -141,7 +141,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -1106,7 +1106,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -2452,7 +2452,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -2827,7 +2827,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -3049,7 +3049,7 @@ dependencies = [ [[package]] name = "pact_models" -version = "1.3.17" +version = "1.3.18" dependencies = [ "anyhow", "ariadne", @@ -4050,7 +4050,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -4116,7 +4116,7 @@ dependencies = [ "security-framework", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -4510,7 +4510,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -4557,7 +4557,7 @@ dependencies = [ "cfg-if", "libc", "psm", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -4744,7 +4744,7 @@ dependencies = [ "getrandom 0.4.3", "once_cell", "rustix", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -5550,7 +5550,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] diff --git a/rust/pact_models/CHANGELOG.md b/rust/pact_models/CHANGELOG.md index 992dbce2c..65aa12216 100644 --- a/rust/pact_models/CHANGELOG.md +++ b/rust/pact_models/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [1.3.18](https://github.com/pact-foundation/pact-reference/compare/pact_models-v1.3.17...pact_models-v1.3.18) - _2026-11-13_ + +### ๐Ÿ“š Documentation + +- _(pact_models)_ Curate the release changelog + ## [1.3.17](https://github.com/pact-foundation/pact-reference/compare/pact_models-v1.3.16...pact_models-v1.3.17) - _2026-10-21_ ### ๐Ÿ› Bug Fixes diff --git a/rust/pact_models/Cargo.toml b/rust/pact_models/Cargo.toml index 61389d810..edda37c2c 100644 --- a/rust/pact_models/Cargo.toml +++ b/rust/pact_models/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pact_models" -version = "1.3.17" +version = "1.3.18" authors = ["Ronald Holshausen "] edition = "2024" description = "Pact-Rust support library that provides the core models for dealing with Pact files" From 6932958a23932fa8f34f02e717e94aead5cc2ace Mon Sep 17 00:00:00 2001 From: "pact-foundation[bot]" <289648111+pact-foundation[bot]@users.noreply.github.com> Date: Fri, 13 Nov 2026 11:49:14 +0000 Subject: [PATCH 04/12] chore(pact_verifier): release v1.6.0 --- rust/Cargo.lock | 2 +- rust/pact_ffi/Cargo.toml | 2 +- rust/pact_verifier/CHANGELOG.md | 14 ++++++++++++++ rust/pact_verifier/Cargo.toml | 2 +- rust/pact_verifier_cli/Cargo.toml | 2 +- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 5a9aa643f..a06dd0357 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -3097,7 +3097,7 @@ dependencies = [ [[package]] name = "pact_verifier" -version = "1.5.0" +version = "1.6.0" dependencies = [ "ansi_term", "anyhow", diff --git a/rust/pact_ffi/Cargo.toml b/rust/pact_ffi/Cargo.toml index 40665190e..3e4434c72 100644 --- a/rust/pact_ffi/Cargo.toml +++ b/rust/pact_ffi/Cargo.toml @@ -33,7 +33,7 @@ pact_matching = { version = "2.2.0", path = "../pact_matching" } pact_mock_server = "2.2.6" pact_models = { version = "1.3.16" } pact-plugin-driver = { version = "1.2.3" } -pact_verifier = { version = "1.5.0", path = "../pact_verifier" } +pact_verifier = { version = "1.6.0", path = "../pact_verifier" } panic-message = "0.3.0" rand = "0.9.5" rand_regex = "0.18.1" diff --git a/rust/pact_verifier/CHANGELOG.md b/rust/pact_verifier/CHANGELOG.md index 400b583e5..1fbf7233e 100644 --- a/rust/pact_verifier/CHANGELOG.md +++ b/rust/pact_verifier/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [1.6.0](https://github.com/pact-foundation/pact-reference/compare/pact_verifier-v1.5.0...pact_verifier-v1.6.0) - _2026-11-13_ + +### ๐Ÿš€ Features + +- Allow the provider state change retries to be set with PACT_PROVIDER_STATE_CHANGE_RETRIES + +### ๐Ÿ› Bug Fixes + +- _(pact_verifier)_ Apply generators to form-urlencoded request bodies + +### ๐Ÿ“ฆ Other + +- Merge pull request #592 from ChangkeunJ/fix/verifier-form-urlencoded-generators + ## [1.5.0](https://github.com/pact-foundation/pact-reference/compare/pact_verifier-v1.4.7...pact_verifier-v1.5.0) - _2026-10-21_ ### ๐Ÿš€ Features diff --git a/rust/pact_verifier/Cargo.toml b/rust/pact_verifier/Cargo.toml index 2cece427a..1c4887542 100644 --- a/rust/pact_verifier/Cargo.toml +++ b/rust/pact_verifier/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pact_verifier" -version = "1.5.0" +version = "1.6.0" authors = ["Ronald Holshausen "] edition = "2024" description = "Pact-Rust support library that implements provider verification functions" diff --git a/rust/pact_verifier_cli/Cargo.toml b/rust/pact_verifier_cli/Cargo.toml index 55f3d3cfa..941db21f4 100644 --- a/rust/pact_verifier_cli/Cargo.toml +++ b/rust/pact_verifier_cli/Cargo.toml @@ -32,7 +32,7 @@ log = "0.4.27" maplit = "1.0.2" pact_matching = { version = "2.2.0", path = "../pact_matching", default-features = false } pact_models = { version = "1.3.16", default-features = false } -pact_verifier = { version = "1.5.0", path = "../pact_verifier", default-features = false } +pact_verifier = { version = "1.6.0", path = "../pact_verifier", default-features = false } quick-xml = { version = "0.39.2", features = ["serde", "serialize"] } xrust = "2.0.3" regex = "1.11.1" From 33b27361b84a1450abd7fe4942e3c5a9c25e5850 Mon Sep 17 00:00:00 2001 From: "pact-foundation[bot]" <289648111+pact-foundation[bot]@users.noreply.github.com> Date: Fri, 13 Nov 2026 12:42:18 +0000 Subject: [PATCH 05/12] chore(pact_verifier_cli): release v1.5.0 --- rust/Cargo.lock | 2 +- rust/pact_verifier_cli/CHANGELOG.md | 14 ++++++++++++++ rust/pact_verifier_cli/Cargo.toml | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index a06dd0357..4a30e2c38 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -3145,7 +3145,7 @@ dependencies = [ [[package]] name = "pact_verifier_cli" -version = "1.4.0" +version = "1.5.0" dependencies = [ "ansi_term", "anyhow", diff --git a/rust/pact_verifier_cli/CHANGELOG.md b/rust/pact_verifier_cli/CHANGELOG.md index 7a8e3cedc..cd6f2a780 100644 --- a/rust/pact_verifier_cli/CHANGELOG.md +++ b/rust/pact_verifier_cli/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [1.5.0](https://github.com/pact-foundation/pact-reference/compare/pact_verifier_cli-v1.4.0...pact_verifier_cli-v1.5.0) - _2026-11-13_ + +### ๐Ÿš€ Features + +- Allow the provider state change retries to be set with PACT_PROVIDER_STATE_CHANGE_RETRIES + +### ๐Ÿ› Bug Fixes + +- _(pact_verifier)_ Apply generators to form-urlencoded request bodies + +### ๐Ÿ“ฆ Other + +- Merge pull request #592 from ChangkeunJ/fix/verifier-form-urlencoded-generators + ## [1.4.0](https://github.com/pact-foundation/pact-reference/compare/pact_verifier_cli-v1.3.5...pact_verifier_cli-v1.4.0) - _2026-10-21_ ### ๐Ÿš€ Features diff --git a/rust/pact_verifier_cli/Cargo.toml b/rust/pact_verifier_cli/Cargo.toml index 941db21f4..aaf35c179 100644 --- a/rust/pact_verifier_cli/Cargo.toml +++ b/rust/pact_verifier_cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pact_verifier_cli" -version = "1.4.0" +version = "1.5.0" authors = ["Ronald Holshausen "] edition = "2024" description = "Standalone pact verifier for provider pact verification" From 2e70fc1c38d03e2c140f47c8c980d8679da0d113 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Fri, 13 Nov 2026 13:19:50 +0000 Subject: [PATCH 06/12] chore(deps): update pact_mock_server v2.2.7 --- compatibility-suite/Cargo.toml | 2 +- rust/Cargo.lock | 26 +++++++++++++------------- rust/pact_consumer/Cargo.toml | 2 +- rust/pact_ffi/Cargo.toml | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/compatibility-suite/Cargo.toml b/compatibility-suite/Cargo.toml index 5f7f6f79b..4798f3b8c 100644 --- a/compatibility-suite/Cargo.toml +++ b/compatibility-suite/Cargo.toml @@ -15,7 +15,7 @@ maplit = "1.0.2" pact_consumer = { path = "../rust/pact_consumer" } pact_models = { version = "1.3.16" } pact_matching = { version = "2.0.11" } -pact_mock_server = { version = "2.2.6" } +pact_mock_server = { version = "2.2.7" } pact_verifier = { path = "../rust/pact_verifier" } regex = "1.10.2" reqwest = { version = "0.13.4", default-features = false, features = ["json"] } diff --git a/rust/Cargo.lock b/rust/Cargo.lock index a06dd0357..3d8022b12 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -130,7 +130,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -141,7 +141,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -1106,7 +1106,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -2452,7 +2452,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -2827,7 +2827,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -3019,8 +3019,8 @@ dependencies = [ [[package]] name = "pact_mock_server" -version = "2.2.6" -source = "git+https://github.com/pact-foundation/pact-core-mock-server.git#427966c8a756585a171ddda4a2cdc8f02e88e333" +version = "2.2.7" +source = "git+https://github.com/pact-foundation/pact-core-mock-server.git#cb03341e8bb6c12163ae361a0b2e268e45b60d14" dependencies = [ "anyhow", "bytes", @@ -4050,7 +4050,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -4116,7 +4116,7 @@ dependencies = [ "security-framework", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -4510,7 +4510,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -4557,7 +4557,7 @@ dependencies = [ "cfg-if", "libc", "psm", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -4744,7 +4744,7 @@ dependencies = [ "getrandom 0.4.3", "once_cell", "rustix", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -5550,7 +5550,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] diff --git a/rust/pact_consumer/Cargo.toml b/rust/pact_consumer/Cargo.toml index 2d18cb04e..a3cd3db75 100644 --- a/rust/pact_consumer/Cargo.toml +++ b/rust/pact_consumer/Cargo.toml @@ -29,7 +29,7 @@ bytes = "1.12.1" itertools = "0.15.0" maplit = "1.0.2" pact_matching = { version = "2.2.0", path = "../pact_matching", default-features = false } -pact_mock_server = { version = "2.2.6", default-features = false } +pact_mock_server = { version = "2.2.7", default-features = false } pact_models = { version = "1.3.16", default-features = false } pact-plugin-driver = { version = "1.2.3", optional = true, default-features = false } uuid = { version = "1.24.0", features = ["v4"], optional = true } diff --git a/rust/pact_ffi/Cargo.toml b/rust/pact_ffi/Cargo.toml index 3e4434c72..b897f53cd 100644 --- a/rust/pact_ffi/Cargo.toml +++ b/rust/pact_ffi/Cargo.toml @@ -30,7 +30,7 @@ onig = { version = "6.5.3", default-features = false } # FFI Inmemory sink uses the global static `LOG_BUFFER` in the pact_matching crate. This is required to be the same # version as the mock server crate pact_matching = { version = "2.2.0", path = "../pact_matching" } -pact_mock_server = "2.2.6" +pact_mock_server = "2.2.7" pact_models = { version = "1.3.16" } pact-plugin-driver = { version = "1.2.3" } pact_verifier = { version = "1.6.0", path = "../pact_verifier" } From 6ccd8ce3b1c437733c6e0aaae6baf3739f2a1fa5 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Fri, 13 Nov 2026 14:56:43 +0000 Subject: [PATCH 07/12] chore(pact_verifier_cli): extract release tarball into a workdir in Docker fetch stage (#608) The fetch stage had no WORKDIR, so the tarball unpacked into / and `install pact-verifier /pact-verifier` failed with "are the same file", breaking the Docker image publish for v1.5.0. Co-authored-by: Claude Opus 5.5 --- rust/pact_verifier_cli/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/rust/pact_verifier_cli/Dockerfile b/rust/pact_verifier_cli/Dockerfile index 3625ab5f2..dfed67ab2 100644 --- a/rust/pact_verifier_cli/Dockerfile +++ b/rust/pact_verifier_cli/Dockerfile @@ -4,6 +4,7 @@ FROM --platform=$BUILDPLATFORM alpine:3.22 AS fetch ARG VERSION ARG TARGETARCH RUN apk add --no-cache ca-certificates curl xz +WORKDIR /dist RUN case "$TARGETARCH" in \ amd64) target=x86_64-unknown-linux-musl ;; \ arm64) target=aarch64-unknown-linux-musl ;; \ From 3ae1f42f95435376299b557ef0a34a7cb3ea5162 Mon Sep 17 00:00:00 2001 From: "pact-foundation[bot]" <289648111+pact-foundation[bot]@users.noreply.github.com> Date: Fri, 13 Nov 2026 15:00:05 +0000 Subject: [PATCH 08/12] chore(pact_ffi): release v0.5.13 --- rust/Cargo.lock | 2 +- rust/pact_ffi/CHANGELOG.md | 20 ++++++++++++++++++++ rust/pact_ffi/Cargo.toml | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 591aa8e60..919a5eb29 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -2915,7 +2915,7 @@ dependencies = [ [[package]] name = "pact_ffi" -version = "0.5.12" +version = "0.5.13" dependencies = [ "ansi_term", "anyhow", diff --git a/rust/pact_ffi/CHANGELOG.md b/rust/pact_ffi/CHANGELOG.md index 5a450ef56..aff49c160 100644 --- a/rust/pact_ffi/CHANGELOG.md +++ b/rust/pact_ffi/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [0.5.13](https://github.com/pact-foundation/pact-reference/compare/pact_ffi-v0.5.12...pact_ffi-v0.5.13) - _2026-11-13_ + +### ๐Ÿš€ Features + +- Allow the provider state change retries to be set with PACT_PROVIDER_STATE_CHANGE_RETRIES + +### ๐Ÿ› Bug Fixes + +- Apply the matchers nested under an eachValue matcher + +- _(ffi)_ Keep the plugin transport when writing via pactffi_pact_handle_write_file + +- _(ffi)_ Don't abort the host process when stderr is full + +### ๐Ÿ—๏ธ Build and CI + +- Use caret requirements between pact crates + +- Require pact_mock_server 2.2.6 + ## [0.5.12](https://github.com/pact-foundation/pact-reference/compare/pact_ffi-v0.5.11...pact_ffi-v0.5.12) - _2026-10-19_ ### ๐Ÿ› Bug Fixes diff --git a/rust/pact_ffi/Cargo.toml b/rust/pact_ffi/Cargo.toml index b897f53cd..236227fc7 100644 --- a/rust/pact_ffi/Cargo.toml +++ b/rust/pact_ffi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pact_ffi" -version = "0.5.12" +version = "0.5.13" authors = ["Ronald Holshausen ", "Matt Fellows ", "Andrew Lilley Brinker ", "Caleb Stepanian "] edition = "2021" description = "Pact interface for foreign languages." From 4fb75dafe0ab3ba072547526bf93c14d01fc4319 Mon Sep 17 00:00:00 2001 From: JP-Ellis Date: Mon, 23 Nov 2026 14:37:16 +1100 Subject: [PATCH 09/12] test(pact_verifier_cli): snapshot the HTML report Nothing exercised the XSLT step of the HTML report, so an xrust upgrade could change its output unnoticed. The snapshot pins the output of the default stylesheet for a failing result with a notice and a passing interaction. Assisted-by: Claude Code:claude-opus-5-5 --- rust/pact_verifier_cli/src/reports/mod.rs | 56 +++ ..._tests__html_report_with_default_xslt.snap | 426 ++++++++++++++++++ 2 files changed, 482 insertions(+) create mode 100644 rust/pact_verifier_cli/src/reports/snapshots/pact_verifier_cli__reports__tests__html_report_with_default_xslt.snap diff --git a/rust/pact_verifier_cli/src/reports/mod.rs b/rust/pact_verifier_cli/src/reports/mod.rs index e1b446ba8..07dd77e1b 100644 --- a/rust/pact_verifier_cli/src/reports/mod.rs +++ b/rust/pact_verifier_cli/src/reports/mod.rs @@ -148,3 +148,59 @@ pub(crate) fn write_html_report( Ok(()) } + +#[cfg(test)] +mod tests { + use std::collections::HashMap; + use std::time::Duration; + + use insta::assert_snapshot; + use pact_matching::Mismatch; + use pact_verifier::verification_result::{ + VerificationExecutionResult, VerificationInteractionResult, VerificationMismatchResult, + }; + + use super::*; + + #[test] + fn html_report_with_default_xslt() { + let mut notice = HashMap::new(); + notice.insert("text".to_string(), "This pact is being verified because it is the latest version".to_string()); + let result = VerificationExecutionResult { + result: false, + notices: vec![notice], + errors: vec![ + ( + "GET /foo returns 200".to_string(), + VerificationMismatchResult::Mismatches { + mismatches: vec![ + Mismatch::StatusMismatch { + expected: 200, + actual: 404, + mismatch: "expected 200 but was 404".to_string(), + }, + ], + interaction_id: Some("interaction-123".to_string()), + }, + ), + ], + interaction_results: vec![ + VerificationInteractionResult { + interaction_id: None, + interaction_key: None, + consumer: "My Consumer".to_string(), + provider: "My Provider".to_string(), + provider_states: vec![], + description: "request 1".to_string(), + interaction_description: "POST /bar returns 201".to_string(), + result: Ok(()), + pending: false, + duration: Duration::from_millis(15), + }, + ], + ..VerificationExecutionResult::default() + }; + let xml = xml::to_xml_string(&result, "My Provider").unwrap(); + assert_snapshot!(apply_xslt(&xml, None).unwrap()); + } +} diff --git a/rust/pact_verifier_cli/src/reports/snapshots/pact_verifier_cli__reports__tests__html_report_with_default_xslt.snap b/rust/pact_verifier_cli/src/reports/snapshots/pact_verifier_cli__reports__tests__html_report_with_default_xslt.snap new file mode 100644 index 000000000..c644858b2 --- /dev/null +++ b/rust/pact_verifier_cli/src/reports/snapshots/pact_verifier_cli__reports__tests__html_report_with_default_xslt.snap @@ -0,0 +1,426 @@ +--- +source: pact_verifier_cli/src/reports/mod.rs +expression: "apply_xslt(&xml, None).unwrap()" +--- + +Pact Verification Report โ€” My Provider
Pact ยท Verification Report

My Provider

Provider Contract Verification

โœ—
Failed

Summary

1
Total
1
Passed
1
Failed
0
Pending

Notices

โ„นThis pact is being verified because it is the latest version

Failures

FailureGET /foo returns 200
TypeLocationDescriptionExpectedActual
Statusexpected 200 but was 404200404

Interaction Results

InteractionStatusDuration
POST /bar returns 201โœ“ Passed15 ms
+ Generated by Pact ยท pact_verifier_cli +
From 4a24afcf08e0f0502141deae87591fd040dc25e8 Mon Sep 17 00:00:00 2001 From: JP-Ellis Date: Mon, 23 Nov 2026 14:37:43 +1100 Subject: [PATCH 10/12] fix(pact_verifier_cli): build against xrust 2.4 xrust broke its API in two minor releases, and the old requirement `xrust = "2.0.3"` admitted both: - 2.3.0 gave `ParseError::MissingNameSpace` the fields `prefix`, `nsuri` and `message`. - 2.4.0 renamed `StaticContextBuilder::fetcher` to `external`. The callback for external resources now takes `&External` and returns `Sequence`, both in the builder and in `xslt::from_document`. Any build that resolved dependencies afresh, such as `cargo install` without `--locked` or a downstream lockfile update, picked up 2.4.1 and failed to compile the report module. The requirement is now 2.4.1, the first release with the current API. The HTML report snapshot is unchanged under 2.4.1. Assisted-by: Claude Code:claude-opus-5-5 --- rust/Cargo.lock | 30 +++++++++++------------ rust/pact_verifier_cli/Cargo.toml | 2 +- rust/pact_verifier_cli/src/reports/mod.rs | 18 ++++++++++---- 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 919a5eb29..f0c189f0c 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -130,7 +130,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -141,7 +141,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -1106,7 +1106,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -2452,7 +2452,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -2827,7 +2827,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -3600,9 +3600,9 @@ dependencies = [ [[package]] name = "qualname" -version = "0.0.1" +version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7ca141ff6dd6af1bf241aa43eac7491d69c9be5059574708495e61948ab4bac" +checksum = "5b7e17688d7e871b907a1d869d01a72e13da2f235e47edd88e003610f26ec7a8" [[package]] name = "quick-xml" @@ -4050,7 +4050,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -4116,7 +4116,7 @@ dependencies = [ "security-framework", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -4510,7 +4510,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -4557,7 +4557,7 @@ dependencies = [ "cfg-if", "libc", "psm", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -4744,7 +4744,7 @@ dependencies = [ "getrandom 0.4.3", "once_cell", "rustix", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -5550,7 +5550,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -5864,9 +5864,9 @@ dependencies = [ [[package]] name = "xrust" -version = "2.2.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb2c761645855d610598e85a199f9e86f805cf6d0d526b26cfedf38582b299f" +checksum = "11e0eacb58c190372d2d26a8716969b53e72ef30e8769748c8cb989cb874a3cd" dependencies = [ "chrono", "english-numbers", diff --git a/rust/pact_verifier_cli/Cargo.toml b/rust/pact_verifier_cli/Cargo.toml index aaf35c179..83793b48c 100644 --- a/rust/pact_verifier_cli/Cargo.toml +++ b/rust/pact_verifier_cli/Cargo.toml @@ -34,7 +34,7 @@ pact_matching = { version = "2.2.0", path = "../pact_matching", default-features pact_models = { version = "1.3.16", default-features = false } pact_verifier = { version = "1.6.0", path = "../pact_verifier", default-features = false } quick-xml = { version = "0.39.2", features = ["serde", "serialize"] } -xrust = "2.0.3" +xrust = "2.4.1" regex = "1.11.1" rustls = { version = "0.23.43", default-features = false, features = ["ring", "logging", "tls12", "std"] } serde = "1.0.228" diff --git a/rust/pact_verifier_cli/src/reports/mod.rs b/rust/pact_verifier_cli/src/reports/mod.rs index 07dd77e1b..629bb586b 100644 --- a/rust/pact_verifier_cli/src/reports/mod.rs +++ b/rust/pact_verifier_cli/src/reports/mod.rs @@ -21,12 +21,20 @@ mod xml; const XSLT: &str = include_str!("verification-report.xsl"); +fn missing_namespace() -> ParseError { + ParseError::MissingNameSpace { + prefix: None, + nsuri: None, + message: Some("namespace prefixes must be declared in the document".to_string()) + } +} + fn node_from_str(s: &str) -> Result { - parse(RNode::new_document(), s, Some(|_: &_| Err(ParseError::MissingNameSpace))) + parse(RNode::new_document(), s, Some(|_: &_| Err(missing_namespace()))) } fn apply_xslt(xml_str: &str, xslt: Option<&String>) -> anyhow::Result { - let doc = parse(RNode::new_document(), xml_str, Some(|_: &_| Err(ParseError::MissingNameSpace)))?; + let doc = parse(RNode::new_document(), xml_str, Some(|_: &_| Err(missing_namespace())))?; let mut s = String::new(); let xslt_doc = if let Some(xslt) = xslt { @@ -36,15 +44,15 @@ fn apply_xslt(xml_str: &str, xslt: Option<&String>) -> anyhow::Result { } else { XSLT }; - let xslt_doc = parse(RNode::new_document(), xslt_doc, Some(|_: &_| Err(ParseError::MissingNameSpace)))?; + let xslt_doc = parse(RNode::new_document(), xslt_doc, Some(|_: &_| Err(missing_namespace())))?; let mut static_context = StaticContextBuilder::new() .message(|_| Ok(())) - .fetcher(|_| Err(Error::new(ErrorKind::NotImplemented, "not implemented"))) + .external(|_| Err(Error::new(ErrorKind::NotImplemented, "not implemented"))) .parser(|_| Err::(Error::new(ErrorKind::NotImplemented, "not implemented"))) .build(); - let mut ctxt = from_document(xslt_doc, None, node_from_str, |_| Ok(String::new()))?; + let mut ctxt = from_document(xslt_doc, None, node_from_str, |_| Ok(Vec::new()))?; ctxt.context(vec![Item::Node(doc)], 0); ctxt.result_document(RNode::new_document()); let seq = ctxt.evaluate(&mut static_context)?; From e77a3bd32553cc324363c576de83b2be9868f252 Mon Sep 17 00:00:00 2001 From: "pact-foundation[bot]" <289648111+pact-foundation[bot]@users.noreply.github.com> Date: Mon, 23 Nov 2026 04:12:48 +0000 Subject: [PATCH 11/12] chore(pact_verifier_cli): release v1.5.1 --- rust/Cargo.lock | 2 +- rust/pact_verifier_cli/CHANGELOG.md | 14 ++++++++++++++ rust/pact_verifier_cli/Cargo.toml | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index f0c189f0c..b41b87cb1 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -3145,7 +3145,7 @@ dependencies = [ [[package]] name = "pact_verifier_cli" -version = "1.5.0" +version = "1.5.1" dependencies = [ "ansi_term", "anyhow", diff --git a/rust/pact_verifier_cli/CHANGELOG.md b/rust/pact_verifier_cli/CHANGELOG.md index cd6f2a780..3849802fc 100644 --- a/rust/pact_verifier_cli/CHANGELOG.md +++ b/rust/pact_verifier_cli/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [1.5.1](https://github.com/pact-foundation/pact-reference/compare/pact_verifier_cli-v1.5.0...pact_verifier_cli-v1.5.1) - _2026-11-23_ + +### ๐Ÿ› Bug Fixes + +- _(pact_verifier_cli)_ Build against xrust 2.4 + +### ๐Ÿงช Testing + +- _(pact_verifier_cli)_ Snapshot the HTML report + +### ๐Ÿ› ๏ธ Miscellaneous Tasks + +- _(pact_verifier_cli)_ Extract release tarball into a workdir in Docker fetch stage ([#608](https://github.com/pact-foundation/pact-reference/pull/608)) + ## [1.5.0](https://github.com/pact-foundation/pact-reference/compare/pact_verifier_cli-v1.4.0...pact_verifier_cli-v1.5.0) - _2026-11-13_ ### ๐Ÿš€ Features diff --git a/rust/pact_verifier_cli/Cargo.toml b/rust/pact_verifier_cli/Cargo.toml index 83793b48c..71309efa6 100644 --- a/rust/pact_verifier_cli/Cargo.toml +++ b/rust/pact_verifier_cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pact_verifier_cli" -version = "1.5.0" +version = "1.5.1" authors = ["Ronald Holshausen "] edition = "2024" description = "Standalone pact verifier for provider pact verification" From 9834ab882791f70d0338d7e97c397aa531a17dec Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Sun, 15 Nov 2026 14:12:09 +0000 Subject: [PATCH 12/12] fix(pact_ffi): run the verification on a thread with an 8 MiB stack pactffi_verifier_execute ran the whole verification on the calling thread, which needs more stack than some callers have. Threads created by Go or the JVM on musl (Alpine) get musl's 128 KiB default, which the verification overflows, crashing the process with SIGSEGV. Run the verification on a scoped thread with an 8 MiB stack and wait for it, on every platform, falling back to the calling thread if the thread cannot be started. The thread-local test run ID is carried over so log callbacks keep working. --- rust/pact_ffi/src/verifier/mod.rs | 72 ++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 2 deletions(-) diff --git a/rust/pact_ffi/src/verifier/mod.rs b/rust/pact_ffi/src/verifier/mod.rs index 8762f1dfc..c800a7efa 100644 --- a/rust/pact_ffi/src/verifier/mod.rs +++ b/rust/pact_ffi/src/verifier/mod.rs @@ -606,12 +606,64 @@ ffi_fn! { fn pactffi_verifier_execute(handle: *mut handle::VerifierHandle) -> c_int { let handle = as_mut!(handle); - handle.execute() + execute_on_verifier_thread(handle) } { EXIT_FAILURE } } +/// Stack size of the thread that runs a verification. This is the usual size of a main thread's +/// stack, which is what the verifier was written against. +const VERIFIER_STACK_SIZE: usize = 8 * 1024 * 1024; + +/// Runs the verification on a thread of its own, and waits for it. +/// +/// The verification is driven on the thread that executes it, and it needs more stack than a +/// foreign caller may have. Threads created by the Go and JVM runtimes, among others, get the +/// platform's default thread stack, which on musl is 128 KiB, and the verification overflows it. +/// Running it on a thread whose stack size we choose makes the result independent of the caller. +fn execute_on_verifier_thread(handle: &mut handle::VerifierHandle) -> c_int { + // The handle is not Send, as the results it stores hold boxed interactions. + struct HandleRef<'a>(&'a mut handle::VerifierHandle); + // SAFETY: The handle is used by one thread at a time: this thread does not touch it until the + // verifier thread has been joined. Nothing in it is tied to the thread it was created on, which + // foreign callers already rely on, as they are free to call each function from a different + // thread. + unsafe impl Send for HandleRef<'_> {} + + // The test run ID is thread local, so carry it over to the thread doing the work. + let test_run_id = pact_plugin_driver::test_context::current_test_run_id(); + + let result = std::thread::scope(|scope| { + let handle = HandleRef(&mut *handle); + let spawned = std::thread::Builder::new() + .name("pact-verifier".to_string()) + .stack_size(VERIFIER_STACK_SIZE) + .spawn_scoped(scope, move || { + // Use the wrapper as a whole, so that the closure captures it and not the field in it + let handle = handle; + pact_plugin_driver::test_context::set_test_run_id(test_run_id); + handle.0.execute() + }); + match spawned { + Ok(thread) => match thread.join() { + Ok(result) => Some(result), + // Let the panic carry on to the caller, as it would have without the thread + Err(panic) => std::panic::resume_unwind(panic) + }, + Err(err) => { + warn!("Could not start a thread to run the verification on, using the calling thread: {}", err); + None + } + } + }); + + match result { + Some(result) => result, + None => handle.execute() + } +} + fn get_vector(items_ptr: *const *const c_char, items_len: c_ushort) -> Vec { if !items_ptr.is_null() && items_len > 0 { let mut items = Vec::with_capacity(items_len as usize); @@ -734,7 +786,23 @@ mod tests { use libc::c_char; use crate::verifier::handle::VerifierHandle; - use crate::verifier::pactffi_verifier_output; + use crate::verifier::{pactffi_verifier_execute, pactffi_verifier_output}; + + // musl gives threads a 128 KiB stack by default, and that is the stack a Go or JVM caller + // will be on when it calls into the verifier. + #[test] + fn pactffi_verifier_execute_does_not_depend_on_the_callers_stack_size() { + let result = std::thread::Builder::new() + .stack_size(128 * 1024) + .spawn(|| { + let mut handle = VerifierHandle::new_for_application("tests", "1.0.0"); + pactffi_verifier_execute(&mut handle) + }) + .unwrap() + .join() + .unwrap(); + expect!(result).to(be_equal_to(0)); + } #[test] fn pactffi_verifier_output_test() {