Hi. I have a question about the pact broker can-i-...
# general
r
Hi. I have a question about the pact broker can-i-deploy behavior. It's a fairly easy use case to work around and I'm not sure if this is specific to the pactflow broker I was using or if the behavior is the same in the open source pact broker. When testing a proof-of-concept bi-directional contract testing setup I found that the
can-i-deploy --to-environment <environmentname>
behavior for the api provider is somewhat unexpected when no environment deploys/releases have happened to the environment yet. In this scenario I would expect that the
can-i-deploy
behavior would not select any pacts for verification because none are in that environment. Instead I found that the behavior was selecting all of the pacts. i.e. 1. Consumer creates first test and uploads pact contract .json (version abcdef1) [from local machine] 2. Provider uploads open api schema (version xzy1) [from local machine] 3. Looking at the pactflow UI we see there are inconsistencies and fix them. 4. Consumer uploads pact contract .json (version abcdef2) [from local machine] 5. Setup proof-of-concept CICD for consumer 5a. Consumer CICD uploads pact contract version (abcdef3) 5b. Consumer CICD calls
can-i-deploy --to-environment production
and gets a 'No' response because no api deployment to production has been recorded. ^ This is the behavior I would expect 6. Setup proof-of-concept CICD for provider 6a. Provider CICD uploads open api schema version (xyz2) 6b. Provider CICD calls
can-i-deploy --to-environment production
and gets a 'No' response. The response shows all 3 consumer contracts (abcdef1, abcdef2, abcdef3) despite none of them being in production. And because abcdef1 is not valid is returns a no. ^ I would expect this to select none of the contracts in scenarios where no consumer version has been deployed to production yet.
m
6b. Provider CICD calls
can-i-deploy --to-environment production
and gets a ‘No’ response.
this behaviour is unexpected to me also. Are you able to share a view of what Pactflow sees (e.g. screen grab from UI matrix page for the provider) so we can understand why? Also, there is a can i deploy page in Pactflow. A screengrab of a populated version of that screen would be helpful too (if not for you, for us to help understand) P.S. this is also a #CLS16AVEE specific feature, might best ask there next time.