Skip to content
Latchkey

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 enablePending in the verifier.
  • Set includeWipPactsSince to a start date to pull WIP contracts.
  • Provide providerVersionBranch so 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

Run this faster and cheaper on Latchkey managed runners. Start free →