Hi, if I use the contract_requiring_verification_p...
# general
h
Hi, if I use the contract_requiring_verification_published webhook lets say I have the following scenario: 1. consumer contract asks for fields that dont yet exist in provider 2. contract is published 3. webhook verifies it 4. verification fails 5. when we run the consumer pipeline again, the contract has not changed, so it will never be verified again ? 6. provider implements the new field how does the contract get re verified for the new provider version? I'm sorry if this is a stupid question. I don't want the webhook to simply trigger every time a contract is published whether it changes or not because that would be excessive. I guess I am wrong about step 5, it should be verified again when a new version of the provider is built, but if I don't see this behaviour, what has gone wrong?
m
That's what a regular provider build is for. You would setup the selectors to verify the usual pacts. If the pact in question is a feature branch, you would use WIP pacts to pull in new contracts to check
See the cicd workshop in howtolearn
s
Here are a number of useful hands-on labs that teach all of the key concepts: https://docs.pactflow.io/docs/workshops and https://docs.pact.io/implementation_guides/workshops
h
Thanks, do you know how the
Copy code
${pactbroker.providerVersionBranch}
var is set? I am using this one for the verification that happens when the Pact file changes. The version of the provider in UAT would be on the develop branch and the version in prod would be on the master branch but how can my Pact broker know this?
I saw this but I am not sure this is what I want because the verify step is where I want to find the branch not set it
Copy code
pact-provider-verifier  \
  --provider "Example API" \
  --provider-app-version $GIT_COMMIT \
  --provider-version-branch
I believe this is what I needed
Copy code
docker run --net=host -e VERBOSE='true' -e PACT_DO_NOT_TRACK=true pactfoundation/pact-cli:latest pact-broker create-or-update-pacticipant --broker-base-url=<https://pact.dev.ieu.intelematics.club/> --name=battery-api  --main-branch=master
m
var is set? I am using this one for the verification that happens when the Pact file changes. The version of the provider in UAT would be on the develop branch and the version in prod would be on the master branch but how can my Pact broker know this?
It knows this, because you use your provider should be recording deployments to the environments it is deployed to
The webhook event knows this, and triggers builds for each of the deployed versions of your app, and also the main branch.