When consumer and provider teams develop the same feature, matching branch names let the provider verify the consumer contract for that feature before either team merges. In Pact, enabling the matching branch rule makes provider verification select the consumer contract whose branch matches the provider branch. A provider can also verify the consumer’s main-branch contract in the same run, combining feature confidence with protection against regressions on the shared baseline. section 10.2.2
Configure the workflow by:
- Publishing consumer versions with their Git commit and branch metadata. section 10.2.2
- Setting matchingBranch to true in consumerVersionSelectors. section 10.2.2
Feature branch verification
If the consumer branch is test-pact-features, the provider uses the same branch name and verifies both that contract and the consumer’s main-branch contract. The MoviesAPI provider can then validate the feature integration without losing baseline coverage.
