Tim Vahlbrock
11/13/2025, 6:08 AMTim Vahlbrock
11/17/2025, 7:30 AMTim Vahlbrock
11/17/2025, 8:05 AMMatt (pactflow.io / pact-js / pact-go)
Tim Vahlbrock
11/17/2025, 9:42 AMA pact's content is pending for all branches of a provider until the first successful verification has been published.I just don't get why the pact is no longer verified, if the verification success was on a feature branch.
Matt (pactflow.io / pact-js / pact-go)
I just don’t get why the pact is no longer verified, if the verification success was on a feature branch.this is new info. What’s not verifying it?
Tim Vahlbrock
11/17/2025, 9:51 AMMatt (pactflow.io / pact-js / pact-go)
A pact’s content is pending for all branches of a provider until the first successful verification has been published. From then on, it is no longer pending for the provider branch that published the successful verification, and will not be pending for any other new provider branches created thereafter. It will stay in pending for branches that already existed at the time of the successful verification.So I think this confirms it, and presumably the feature branch prior to A (
A-1 ) will also treat the pact as pending false.
The reason for the “…any other new provider branches” logic is probably because it’s hard for the broker to check if new branches actually contain the code that implements the pending pact, and crudely says “it was created after this branch” (implying it may have that code in it).Matt (pactflow.io / pact-js / pact-go)
1. Branch B is created from A. verifies, but is not yet merged. Verification Results are published however (maybe that’s the mistake?)It is recommended generally to have verification results published here, so you’re not doing the “wrong” thing
Tim Vahlbrock
11/17/2025, 10:07 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Tim Vahlbrock
11/17/2025, 11:31 AMIn terms of short term options, I suppose not publishing verification results could work, but then you’d lose out on other important info (like, is the branch safe to merge/deploy)Are you sure? I would still publish but only on main (or whatever is the default branch). Then the consumer branch would be safe to publish (or deploy) when the provider has merged (which is correct). What I think would change is: • the consumer would know a little later, that there is a version of the provider that is able to verify this pact • a feature branch that once verified the contract would be allowed to break it again without failing the test, because the broker does not know of the succesful verification
Tim Vahlbrock
11/17/2025, 11:34 AMI think one way to potentially try and solve this, is make pending more user configurable - rather than Pact Broker enforcing a workflow, allow the users to decide (if they want to override the behaviour).Yeah I thought about this as well. What I would think of as practical would be an option to set, that would mark a pact as pending, as long as it has not yet been verified on the default branch. I would think that that would cover most cases already.
Yousaf Nabi (pactflow.io)
A pact’s content is pending for all branches of a provider until the first successful verification has been published. From then on, it is no longer pending for the provider branch that published the successful verification, and will not be pending for any other new provider branches created thereafter. It will stay in pending for branches that already existed at the time of the successful verification.a pact would be pending for the providers main branch, even once it has been verified by the consumers feature branch. new branches would not see it as pending, existing branches would see it as pending. you should have
enablePending set to true, in the providers job, and you could restrict the include WIP pacts, to only run on the providers main branch.
that way provider features branches only test against your consumer version selectors ( deployed/released true, mainBranch true is the default), and don’t pick up WIP pacts.
Does this mean, the other feature branches would need to wait for the branch that originally verified the contract to be merged? Or shouldn’t a feature branch upload verification results in the first place?I don’t believe, the earlier branches would need to wait for the verification. Will the enablePending flag, it would not cause the CI job to fail, (as these are considered to not have been pending). They will only have to honour the deployed/released and consumer main. consumer main failure shouldn’t block provider, if provider has never verified it before (ie consumer missed going through a feature branch to verify changed pact first), enablePending, avoids the provider main branch from stopping being deployed, for a version of a contract is has never verified.
We have been able to reproduce this issue with a local broker setup and it doesn’t seem to be relevant, wether the consumer has the mainBranch set or not. What I would expect is that pacts are pending as long as they haven’t been verified on main. Why isn’t this the case?Nice work on a local setup, might be worth creating a public reproducer mapping out the scenarios and expected behaviour, so that we can huddle around the example and test out hypothesis.
• the consumer team hasn’t fully finished up setting their pact configuration and so far has only published pacts for their tagged versions (where the providerBranch is also set to the Tag). Their main branch in the Pact Broker is not yet set.You can’t use pending pacts with your current setup, as you are using tags, not branches
• Ensure consumer has configured the mainBranch property
• Ensure consumer sets branch and version properties when publishing pacts
• Ensure provider sets branch and version properties when verifying pacts
• enable the pending pacts feature by setting(or equivalent for your language) toenablePendingin the provider verification configurationtrue
Tim Vahlbrock
11/17/2025, 12:49 PMa pact would be pending for the providers main branch, even once it has been verified by the consumers feature branch. new branches would not see it as pending, existing branches would see it as pending.Yes, that's the problem. Any new branch will not see the contract as pending, but also not contain the changes to verify it successfully, because the implementing branch has not yet been merged.
you should haveset to true, in the providers job, and you could restrict the include WIP pacts, to only run on the providers main branch.enablePending
enablePending is configured. WIP currently are enabled for all branches. However, if I disabled it, the feature branch trying to implement the new contract also wouldn't include it in its verification attempt, right? This means that I would need to specify it in the consumer version selectors to verify it on that branch, which seems to eliminate most of the benefits of pending pacts and WIP pacts.
I don’t believe, the earlier branches would need to wait for the verification.Yes, but we have problems with the branches created after the branch that initially verifies the contract, but that is not merged.
Nice work on a local setup, might be worth creating a public reproducer mapping out the scenarios and expected behaviour, so that we can huddle around the example and test out hypothesis.This was just a bit of docker compose and fiddling with the Example App and Example API project.
You can’t use pending pacts with your current setup, as you are using tags, not branchesWhen I referred to as Tags here were GitLab Tags, used for versioning the service.
• Ensure consumer has configured the mainBranch property
• Ensure consumer sets branch and version properties when publishing pactsTo be honest, I don't quite get how these influence the problem. Yes, the actual consumer seems to have messed up setting these correctly, but I was able to reproduce the mentioned issue with a setup that did have consumer branch, version, and mainBranch set correctly, but I could check that again. Also, from what I can tell the pending pacts implementation in the broker doesn't seem to care for any consumer property whatsoever when calculating the pending state of the contract.