I was reading on <pending pacts> and how to use wi...
# pact-jvm
s
I was reading on pending pacts and how to use with Pact JVM. The system properties mention that besides setting pactbroker.enablePending = true you also have to provide pactbroker.providerBranch or pactbroker.providerTags. Why is that? The language agnostic doc does not mention anything about that.
r
Those are the requirements from the Pact Broker. You must understand that Pact-JVM doesn't do much in this regard. It just sends what you configure to the Broker and then gets a list of Pacts back.
Check the TLDR box on the link you provided. In particular:
Ensure provider sets branch and version properties when verifying pacts
m
The reason is that a “pending” pact is a relative condition. A pact may be pending for one branch, but not for another
m
@Matt (pactflow.io / pact-js / pact-go) In the case of a provider PR, the
pactbroker.providerBranch
would be the
<PR_BRANCH_NAME>
, and after merging into the main branch, the
pactbroker.providerBranch
would be
main
. Is that correct? Apologies for the explicit question - in our organization, there was some confusion because even PRs ( which have pending pacts enabled) have
pactbroker.providerBranch
always set to
main
m
Yes that’s correct. You want to keep the broker informed of the branch info so we can track which branch is compatible with various consumer
thankyou 1