How is the can-i-deploy triggered by the consumer,...
# pact-broker
a
How is the can-i-deploy triggered by the consumer, and when does the consumer know when the provider has finished verifying the pacts, to then run can-i-deploy
👀 1
b
You can trigger it with a webhook that fires when the provider has published a successful verification.
But generally, you want to do your feature work on a branch, and wait until that pact is verified before you merge into master.
By that stage, the pact is pre-verified, so can-i-deploy will pass immediately on master, and you can just deploy.
If you do the CI/CD workshop, it will explain the workflow https://docs.pactflow.io/docs/workshops/ci-cd
💯 1
☝️ 3
a
So is the whole new pact process being ran on every commit (in another branch)?
If that is the case, wouldn't that be a bit overkill, especially if you have a limit on GH actions minutes
The way I understand it is, on every commit a new pact is made and published to pact flow. Then when there is a PR, can_i_deploy is ran
Correct me if I'm wrong
s
if a pact does not change, the verification is re-used
a
Yes I understand that, I'm asking if a new pact is generated
b
if a new pact is generated, then yes, a webhook would trigger a build of the provider. Otherwise, you would need to wait for the provider to run their build for other reasons, and it makes the feedback slower.
If we already have schema and integration tests in our CI pipelines and are tested as a part of each PR to master, do I still benefit from using Pact?
Can/do your integration tests run on your local development machine, or do they need to be deployed to an environment to run?
If they need to be deployed, the advantage with contract tests is that they can be run BEFORE you commit (on the provider side), and before you deploy on the consumer side, so you know as soon as possible whether or not you’re compatible.
Here are the advantages https://docs.pact.io/faq/convinceme
s
If we already have schema and integration tests in our CI pipelines and are tested as a part of each PR to master, do I still benefit from using Pact?
Also - pact can give you convince which specific versions work with each other, rather than just "the version I tested against when the integration tests ran" (which can be hard to determine)