Hello! I have a question about `can-i-deploy` chec...
# pact-broker
s
Hello! I have a question about
can-i-deploy
checks. Currently I have set up as follows: Consumer CI pipeline: 1. Run contract tests & publish pacts 2. (if
contract_requiring_verification
, also run provider verification via webhook) 3. can-i-deploy checks for beta & productions envs Consumer Deploy pipeline 1. Run contract tests & publish pacts 2. can-i-deploy checks for beta 3. Deploy to beta 4. record-deployment for beta 5. Deploy to production 6. record-deployment for production Provider CI/CD is pretty much the same, besides provider verification job step. However, I ran into an issue... I wanted to change a Provider state setup. To do that I first added a new provider state, then deployed it to production. This new provider state is not yet used at this point. Then I wanted to deploy Consumer to make an existing test use this new improved provider state, but Step (3) of Consumer CI pipeline fails, because
There is no verified pact between version between version x of consumer and version of provider currently in beta
... What can I do to resolve this? Should I not run can-i-deploy checks in some conditions? Does solution to this situation have something to do with pending or wip pacts (I have pending pacts enabled, but not wip)?
y
I’m a bit confused.
Then I wanted to deploy Consumer to make an existing test use this new improved provider state, but Step (3) of Consumer CI pipeline fails,
What was the result of the verification triggered by the webhook, this should have triggered for main line and deployed/released versions of that provider
s
What was the result of the verification triggered by the webhook in step 2
It succeeded and reported that this pact is verified.
this should have triggered for main line and deployed/released versions of that provider
Oh so what you are saying is that the second step should trigger provider verification jobs between my new consumer version and all environments? So if I have beta and production environment, it should run 2 (or 3) jobs. • with version currently in beta • with version currently in prod • (maybe also with version currently in master, which I currently do)
y
yeah so if you have 2 envs, and the versions are diff from provider main branch i would expect 3 webhooks. your ci would need to checkout the correct version of the code ( which is why we recommend the sha as part of the consumer version number - but whichever way works to identify the versions released/deployed and how to get the codebase in that state ) - if you didn’t check out the correct version, its likely that all three verifications would run against your main branch ( and as they publish results, they would only publish for that version ) https://docs.pact.io/pact_broker/webhooks#using-webhooks-with-the-contract_requiring_verification_published-event
s
Ah okay I am starting to understand what is the issue now. We have actually multiple integrations already that have worked flawlessly and this started occurring with the latest provider service we added. the reason it has worked for the previous ones is that the provider version was same across all envs. That's why triggering one job was sufficient. Ideally it will be the same. Something is off with the new provider CD pipeline that has an incosistent versioning and environment tagging. Since ACTUALLY the version is the same across all envs currently, it should work when running provider verification against this.