How to Use Pending and WIP Pacts to Avoid Blocking
Pending pacts let the provider see failures for new contracts as informational instead of build-breaking, so consumers can publish early.
Set enablePending: true so failures for pacts not yet successfully verified do not fail the build, and includeWipPactsSince to pull in brand-new consumer contracts for a heads-up.
Steps
- Turn on
enablePendingin the verifier. - Set
includeWipPactsSinceto a start date to pull WIP contracts. - Provide
providerVersionBranchso pending status is computed per branch.
Verifier options
provider.verify.js
await new Verifier({
provider: 'orders-api',
providerBaseUrl: 'http://localhost:8080',
pactBrokerUrl: process.env.PACT_BROKER_BASE_URL,
pactBrokerToken: process.env.PACT_BROKER_TOKEN,
providerVersion: process.env.GITHUB_SHA,
providerVersionBranch: process.env.GITHUB_REF_NAME,
enablePending: true,
includeWipPactsSince: '2026-01-01',
publishVerificationResult: true,
}).verifyProvider();Gotchas
- Once a pending pact is verified successfully on a branch, it stops being pending and future failures block the build.
- WIP pacts require a provider version branch to be set.
Related guides
How to Trigger Provider Verification With Broker WebhooksConfigure a Pact Broker webhook so a newly published or changed consumer contract automatically triggers the…
How to Detect Breaking API Changes in CIDetect breaking API changes in CI by diffing the OpenAPI spec with oasdiff and failing the pull request when…