Vittorio Guerriero
12/28/2022, 4:34 PMcan-i-deploy
Is it possible to specify the version of a Pacticipant through the environment?
Basically we would like to do this
pact-broker can-i-deploy --pacticipant AConsumer --version ${gitHash} --pacticipant AProvider --environment prod
This should only check for the Provider version with the environment prod.
We are currently using pact-node and I couldnāt find a way to do thisVittorio Guerriero
12/28/2022, 4:36 PMcan-i-deploy
that fails.Vittorio Guerriero
12/28/2022, 4:37 PM"@pact-foundation/pact-node": "10.17.2",
Vittorio Guerriero
12/28/2022, 4:41 PM--to-environment
because this would include all the Providers in this instance.
We would like to specify a single pacticipant with another single pacticipant.
Let me know which other info you need!Timothy Jones
12/28/2022, 9:03 PMpact-core
instead of pact-node? Itās the core that backs pact-js@10 and aboveTimothy Jones
12/28/2022, 10:02 PMJust to clarify that we cannot use --to-environment because this would include all the Providers in this instance.We would like to specify a single pacticipant with another single pacticipant. What is the reason that this is a problem? The use-case for
--to-environment
is to see if it is safe to deploy the application (ie, including all of its dependencies)Vittorio Guerriero
12/29/2022, 7:26 AMCan you useI can certainly do! I was using pact-node because I was simply running the commands from a shell rather than creating a javascript script. Is there a specific reason why is recommended over pact-node?instead of pact-node? Itās the core that backs pact-js@10 and abovepact-core
We would like to specify a single pacticipant with another single pacticipant.Basically, we are following an approach without webhook at Cazoo, As part of the consumer pipeline we ⢠run the tests ⢠publish the pacts ⢠run can-i-deploy -> this is the one that I would like to change ⢠run the verification only if the previous can-i-deploy failed ⢠ā¦. This gives us the advantage that we have an immediate response from the Provider if the verification failed or succeeded. The need of using can-i-deploy with a single Consumer and Provider is to control which verifications we want to trigger. Example ConsumerA is consuming different APIs from 2 different Provider. ProviderA and ProviderB. ConsumerA make a change to the pact that is compatible with ProviderB and it does not affect ProviderA ConsumerA will publish the pacts ConsumerA will run can-i-deploy, it will fail for ProviderB but it will succeed for ProviderA ConsumerA will run the verification on the ProviderB but not the ProviderA
Vittorio Guerriero
12/29/2022, 7:26 AManto
12/29/2022, 8:09 AMTimothy Jones
12/29/2022, 9:04 AMIs there a specific reason why is recommended over pact-node?Yes, the latest version of the binaries are in pact-core. Pact-node was renamed
pact-core
to reduce confusion (it was a core package without a convenient DSL that sometimes people mistook for the package to use if you were doing server side node). 9.x depends on pact-node, while 10.x uses pact-core.Timothy Jones
12/29/2022, 9:19 AMTimothy Jones
12/29/2022, 10:32 AMTimothy Jones
12/29/2022, 10:35 AMTimothy Jones
12/29/2022, 10:38 AMTimothy Jones
12/29/2022, 10:39 AManto
12/29/2022, 11:01 AMTimothy Jones
12/29/2022, 11:05 AMTimothy Jones
12/29/2022, 11:06 AMTimothy Jones
12/29/2022, 11:09 AMTimothy Jones
12/29/2022, 11:10 AMTimothy Jones
12/29/2022, 11:15 AMpact-broker can-i-deploy --pacticipant AConsumer --version ${gitHash} --pacticipant AProvider --environment prod
should have --to-environment
not --environment
, yes?Timothy Jones
12/29/2022, 11:17 AMIf you declare two (or more) application versions as well as a --to ENVIRONMENT, then the Pact Broker will work out what integrations your declared applications will have in that environment when determining if it safe to deploy.So, I think youād need a version for
AProvider
(even if it is just --latest
)Timothy Jones
12/29/2022, 11:21 AMTimothy Jones
12/29/2022, 11:31 AM--ignore
?anto
12/29/2022, 11:36 AManto
01/11/2023, 11:07 AMpact-broker can-i-deploy --pacticipant=a_consumer --version=consumer_version --pacticipant=a_provider --latest --in_environment=Prod -b=broker_url -k=a_token
anto
01/12/2023, 7:46 AM