Roma Abrosimov
07/11/2023, 3:53 PMcan-i-deploy feature. The background is that Pact broker webhook intercepts event like "Contract published that requires verification" and send 2 requests
To verify single contract against providers:
• (deployed in production) build
• (latest version from main branch) build
Using can-i-deploy tool I can get results of verification for (deployed in production) build like:
pact-broker can-i-deploy \
--pacticipant consumer \
--version ${GIT_COMMIT} \
--to-environment production
The question is how to get results of verification for (latest version from main branch) build using can-i-deploy?
I'm trying this command but it doesn't work:
P.S. I'm using branches not tags.
pact-broker can-i-deploy \
--pacticipant consumer --version ${GIT_COMMIT} \
--pacticipant provider --latest master \
--broker-base-url https://mytest.pactflow.io \Computer says no ¯\_(ツ)_/¯ CONSUMER | C.VERSION | PROVIDER | P.VERSION | SUCCESS? | RESULT# -----------|------------|----------|-----------|----------|-------- consumer | 13d20aa... | provider | ??? | ??? |
No version with tag master exists for providerYousaf Nabi (pactflow.io)
pact-broker can-i-deploy \
--pacticipant consumer \
--version ${GIT_COMMIT} \
--to-environment production
this is correct for your consumer.
It publishes verification results against the providers main branch, but that isn’t relevant when deploying to consumers code, as it cares about what is in the deployed env. the triggered provider verification would check that the providers latest from main is still compatible, and if it isn’t it would stop the providers codebase from being deployed
For your provider you would use can i deploy with the git commit for the version to deploy on your main branch.
pact-broker can-i-deploy \
--pacticipant provider \
--version ${GIT_COMMIT} \
--to-environment productionRoma Abrosimov
07/11/2023, 4:29 PMRoma Abrosimov
07/11/2023, 4:32 PMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Roma Abrosimov
07/11/2023, 4:46 PMRoma Abrosimov
07/11/2023, 5:32 PMpact-broker can-i-deploy
--pacticipant consumer --version HASH \
--pacticipant provider --branch main
this will compare particular contract with the "latest version from main branch"