Kyle C
05/24/2022, 5:19 PMKyle C
05/24/2022, 8:28 PMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
• “Dry run” mode, where the results can be viewed, but the exit code is always successful, so that you can check that your pipeline working as expected before enabling theFrom https://docs.pact.io/pact_broker/can_i_deploy#further-reading Documented in the readme, which is propagated to the docs site https://docs.pact.io/pact_broker/client_cli/readme#can-i-deploy Maybe the word breakglass or something would be a good keyword to add, to aid searching.check fully.can-i-deploy
[--dry-run], [--no-dry-run]
# When dry-run is enabled, always exit process with a success
code. Can also be enabled by setting the environment variable PACT_BROKER_CAN_I_DEPLOY_DRY_RUN=true.
I am assuming this will do the trick, as it will return a success codeYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
I know there’s a ‘right-way’ to handle this, but I can’t seem to figure it out based on the documentation here: https://docs.pact.io/pact_nirvana/step_7 I’ve got everything in place (minus the webhooks)You can verify in a webhookless flow https://docs.pact.io/pact_nirvana/step_6#alternative-webhookless-workflow Example repo here https://github.com/pactflow/example-consumer-webhookless
Matt (pactflow.io / pact-js / pact-go)
I guess the real trick here is the fact that we made a ‘breaking change’ and we should have provided backword compatibility. Since we didn’t we just have to disable the can-i-deploy checks for the provider for now to get a valid build out there?You can definitely make a “breaking change” (breaking in the traditional sense) to an API, provided that no consumers would be impacted by the change. At the time of deployment, the provider must be compatible with the consumer in the target environment (e.g. environment=
prod
) and probably with the current mainline (e.g. branch= main
)Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
The error I get when trying to ‘deploy’ the provider is there is no verified pact between the version of the ‘consumer’ current deployed or released to test and version ‘provider_version’ of ‘provider’This tells me that you’re not verifying against the environment
test
, so it can’t determine if it’s safe to deploy to test
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
[--dry-run], [--no-dry-run] # When dry-run is enabled, always exit process with a success code. Can also be enabled by setting the environment variable PACT_BROKER_CAN_I_DEPLOY_DRY_RUN=true. This mode is useful when setting up your CI/CD pipeline for the first time, or in a 'break glass' situation where you need to knowingly deploy what Pact considers a breaking change. For the second scenario, it is recommended to use the environment variable and just set it for the build required to deploy that particular version, so you don't accidentally leave the dry run mode enabled.
Yousaf Nabi (pactflow.io)
what if I need to deploy, but Can-I-Deploy (computer) says no?
Buckle your seat belt, Dorothy, 'cause Kansas is going bye-bye. Set x flag.
Beth (pactflow.io/Pact Broker/pact-ruby)
Kyle C
05/24/2022, 11:12 PMKyle C
05/24/2022, 11:17 PMBeth (pactflow.io/Pact Broker/pact-ruby)
Yousaf Nabi (pactflow.io)
Kyle C
05/24/2022, 11:52 PMIn regards to the can-i-deploy failure: in the can-i-deploy error message, does it tell you that there is no consumer version deployed to test, or does it give you the version number that is missing the verification? What are the consumer version selectors you have configured to be verified in the provider verification?What it was showing was
There is no verified pact between version 1.0.0-CONSUMER-203 of consumer-ui and the version of provider currently deployed or released to test (1.1.3-1653402689-main-249)
on the consumer can-i-deploy checkBeth (pactflow.io/Pact Broker/pact-ruby)
Kyle C
05/25/2022, 2:35 PMKyle C
05/25/2022, 2:36 PMBeth (pactflow.io/Pact Broker/pact-ruby)