Imagine a provider service lives in a repo <GitHub...
# general
s
Imagine a provider service lives in a repo GitHub.com/sean/provider.git (hypothetical), it provides an api of 1+1=2; and now, as the owner of this api, I wanted to change it to 1*1=1 (which breaks the contracts, but I did not know) I’d like to get help to understand how pact can help me to know I am checking in something that is impacting my consumers.
y
I'd advise checking out our learning material 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
y
There is a short in browser tutorial that will help showcase Pact and its breaking change detection in action 👍
s
Thanks @Yousaf Nabi (pactflow.io)@Yousaf Nabi (pactflow.io)@Yousaf Nabi (pactflow.io) for sharing the pointers. I did watch the 40 mins videos (4 videos of ~10mins) However, I still did not fully understand how the provider repo’s PR or commit can trigger the consumers’ contract verification (which is implied in this slide https://docs.pactflow.io/resources/pactflow-demo-pack_2020.pdf)
y
Webhooks are used to trigger builds (provider builds when the consumer contract has changed) https://docs.pact.io/pact_broker/webhooks This is the latest webhook event for that purpose https://docs.pact.io/pact_broker/webhooks#using-webhooks-with-the-contract_requiring_verification_published-event In regular provider builds, the provider will verify pacts by a set of defined consumer version selectors, to ensure it is compatible - some of our recommended setups are mentioned here https://docs.pact.io/pact_broker/advanced_topics/consumer_version_selectors Hope this helps a bit
m
Imagine a provider service lives in a repo GitHub.com/sean/provider.git (hypothetical), it provides an api of 1+1=2; and now, as the owner of this api, I wanted to change it to 1*1=1 (which breaks the contracts, but I did not know)
is this a functional change, or an API interface change? That matters, because Pact isn’t a functional testing tool
i.e. it doesn’t check for side effects
s
I felt it’s contract testing (we want to make sure the contract is what we want to facilitate among teams)
m
can you be more explicit with your hypothetical example though? is
1+1=2
the body of the code, or the API?