Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
a9b2c69
fix(pact_verifier): apply generators to form-urlencoded request bodies
ChangkeunJ Oct 26, 2026
9a93b0e
Merge pull request #592 from ChangkeunJ/fix/verifier-form-urlencoded-…
YOU54F Nov 12, 2026
30736dd
chore(pact_matching): release v2.2.0
pact-foundation[bot] Nov 12, 2026
fa5e768
Merge pull request #594 from pact-foundation/release/pact_matching
YOU54F Nov 13, 2026
e28d513
chore(pact_models): release v1.3.18
pact-foundation[bot] Nov 13, 2026
b7b66f1
Merge pull request #590 from pact-foundation/release/pact_models
YOU54F Nov 13, 2026
6932958
chore(pact_verifier): release v1.6.0
pact-foundation[bot] Nov 13, 2026
ce0ada1
Merge pull request #596 from pact-foundation/release/pact_verifier
YOU54F Nov 13, 2026
33b2736
chore(pact_verifier_cli): release v1.5.0
pact-foundation[bot] Nov 13, 2026
2e70fc1
chore(deps): update pact_mock_server v2.2.7
YOU54F Nov 13, 2026
0e10034
Merge pull request #606 from pact-foundation/deps/pact_mock_server-v2…
YOU54F Nov 13, 2026
8691d85
Merge pull request #595 from pact-foundation/release/pact_verifier_cli
YOU54F Nov 13, 2026
6ccd8ce
chore(pact_verifier_cli): extract release tarball into a workdir in D…
YOU54F Nov 13, 2026
3ae1f42
chore(pact_ffi): release v0.5.13
pact-foundation[bot] Nov 13, 2026
4fb75da
test(pact_verifier_cli): snapshot the HTML report
JP-Ellis Nov 23, 2026
4a24afc
fix(pact_verifier_cli): build against xrust 2.4
JP-Ellis Nov 23, 2026
e77a3bd
chore(pact_verifier_cli): release v1.5.1
pact-foundation[bot] Nov 23, 2026
9834ab8
fix(pact_ffi): run the verification on a thread with an 8 MiB stack
YOU54F Nov 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compatibility-suite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
22 changes: 11 additions & 11 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions rust/pact_consumer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ 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_mock_server = { version = "2.2.6", default-features = false }
pact_matching = { version = "2.2.0", path = "../pact_matching", 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 }
Expand Down
20 changes: 20 additions & 0 deletions rust/pact_ffi/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions rust/pact_ffi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pact_ffi"
version = "0.5.12"
version = "0.5.13"
authors = ["Ronald Holshausen <ronald.holshausen@gmail.com>", "Matt Fellows <matt.fellows@onegeek.com.au>", "Andrew Lilley Brinker <abrinker@mitre.org>", "Caleb Stepanian <cstepanian@mitre.org>"]
edition = "2021"
description = "Pact interface for foreign languages."
Expand Down Expand Up @@ -29,11 +29,11 @@ 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_mock_server = "2.2.6"
pact_matching = { version = "2.2.0", path = "../pact_matching" }
pact_mock_server = "2.2.7"
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"
Expand Down
72 changes: 70 additions & 2 deletions rust/pact_ffi/src/verifier/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> {
if !items_ptr.is_null() && items_len > 0 {
let mut items = Vec::with_capacity(items_len as usize);
Expand Down Expand Up @@ -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() {
Expand Down
42 changes: 42 additions & 0 deletions rust/pact_matching/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion rust/pact_matching/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pact_matching"
version = "2.1.0"
version = "2.2.0"
authors = ["Ronald Holshausen <ronald.holshausen@gmail.com>"]
edition = "2024"
description = "Pact-Rust support library that implements request and response matching logic"
Expand Down
6 changes: 6 additions & 0 deletions rust/pact_models/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion rust/pact_models/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pact_models"
version = "1.3.17"
version = "1.3.18"
authors = ["Ronald Holshausen <ronald.holshausen@gmail.com>"]
edition = "2024"
description = "Pact-Rust support library that provides the core models for dealing with Pact files"
Expand Down
14 changes: 14 additions & 0 deletions rust/pact_verifier/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 4 additions & 3 deletions rust/pact_verifier/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pact_verifier"
version = "1.5.0"
version = "1.6.0"
authors = ["Ronald Holshausen <ronald.holshausen@gmail.com>"]
edition = "2024"
description = "Pact-Rust support library that implements provider verification functions"
Expand All @@ -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"
Expand All @@ -35,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 }
Expand Down
Loading
Loading