Search code examples
providerverificationconsumerpactcdc

Pact Broker - What is the difference between the pact jvm system properties pactbroker.providerBranch and pact.provider.branch?


I have read a few different meanings of the pact jvm system properties pactbroker.providerBranch and pact.provider.branch. In the following i tried to summarize whats happening when i start a provider verification with regard to the used system properties in parentheses - and especially what are the two system properties doing in my understanding:

 mvn verify \
   -Dpactbroker.providerBranch=feature/new-rest-endpoint \
   -Dpactbroker.enablePending=true \
   -Dpactbroker.includeWipPactsSince=2022-10-21 \
  '-Dpactbroker.consumerversionselectors.rawjson=[{"mainBranch":true},{"deployedOrReleased":true},{"matchingBranch":true}]' \
   -Dpact.verifier.publishResults=true \
   -Dpact.provider.version=123456 \
   -Dpact.provider.branch=feature/new-rest-endpoint

We are in a feature-branch of a provider. When the system 
properties above are set, the verification is done for pacts where the 
provider 'Provider' is part of and ... :

the latest pending pacts (pactbroker.enablePending=true):
--- pact consumer meets consumerversionselector criterias and
--- the pact hasn't been verified successfully so far
OR
the latest work in progress pacts 
    (pactbroker.includeWipPactsSince=06-16-2022):
--- all pending pacts which hasnt been selected by enablePending and
--- the pacts were created within the last two weeks
OR
the latest pact of consumer branch 'master' 
  which is not pending and could be already verified 
  (consumerversionselector:mainBranch=true)
OR
the latest pact which is recorded as deployed 
  on one of our environments (dev, preprod) 
  which is not pending and could be already verified 
  (consumerversionselector:deployedOrReleased=true)
OR
the latest pact whose consumer branch name is the same
  as the provider branch which is not pending and 
  could be already verified 
  (consumerversionselector:matchingBranch=true matching pactbroker.providerBranch)

When publishing the verificaton results within a feature-branch
of the provider, this system properties are important
for setting provider version and provider branch:
  -Dpact.verifier.publishResults=true
  -Dpact.provider.version=123456
  -Dpact.provider.branch=feature/new-rest-endpoint

Is this interpretation correct? Does this setting makes sense in general?

Im using Pact-JVM 4.3.9 and Pactbroker 2.93.2.


Solution

  • This is the definitive list of JVM system properties: https://docs.pact.io/implementation_guides/jvm/docs/system-properties