Hi all, Got a question regarding workflow. So we h...
# pact-broker
p
Hi all, Got a question regarding workflow. So we have Consumer A which has PACTs with Provider B at 3 tags (dev, preprod & prod – we haven’t moved to environments yet). This is working fine. We introduce Provider C which is a provider to Consumer A. We release Provider C to dev as we have set the
failIfNoPactsFound
for the pact:verify and can-i-deploy. Consumer A has a new PACT created to Provider C and released to dev. This works OK. The problem we found is trying to release Provider C to ‘preprod’ where the can-i-deploy says it cannot as there isn’t Consumer A in preprod (which it is true that there isn’t this integration contract between these pacticipants in preprod). I think this though should be a valid workflow (it’s as though it found the integration, so expects the PACT to be available at all tags). We got around it 1st time by deleting the integration, then deploying the provider to all environments before introducing the new Consumer A v Provider C PACT (but think this is a bit of a blunt hammer). It would be good to understand if we are missing something here, and is it something that may be helped through moving to environments? Many thanks in advance.
b
I think there may be a bug in can-i-deploy for the scenario of introducing a new provider. I've got a failing test case for it here https://github.com/pact-foundation/pact_broker/commit/5bcf6e66d70a5911333366c494a675469f1d0924
I'm very certain this used to work, so I think it may have been introduced when I made some changes a while ago.
The work around for now is to set the environment variable PACT_BROKER_CAN_I_DEPLOY_DRY_RUN=true for the first deployment of the provider.
p
Many thanks for your quick response. We have added this variable and can-i-deploy now works in our case, but a couple of things as I understand that this will not fail even if can-i-deploy fails. 1. When can it be removed? Does it need at least 1 consumer to be at each tag that is being checked with can-i-deploy (in our case 'dev', 'preprod', 'prod')? And once there is 1 consumer, others can be added an environment at a time without being expected to be on each one? 2. Is there a bug report on this that we can keep an eye out for any fix? Many thanks
@Beth (pactflow.io/Pact Broker/pact-ruby) Sorry for the tag, but any update in this. The provider has other consumers, so I am not sure that the dry run is what we want in case there are problems there. I guess we could use ignore option in can-i-deploy, but that would need a future code change to remove it (and our projects use a common can-i-deploy script that currently have this parameterised). The other way I can think is to keep to deleting the integration from the broker until that consumer is going to be released across the enviornments. Any other thoughts? Thanks
b
@Paul I believe I've fixed this bug. Can you update to the latest version (2.95.1) and see if you are getting the expected results?
@Paul were you able to confirm this is fixed?
p
@Beth (pactflow.io/Pact Broker/pact-ruby) We have got an upgrade to the latest version on our backlog at the moment. I'll try to push priority of it again, and let you know when available (its another thing on list to make a business case for moving across to pactflow).
👍🏼 1
@Beth (pactflow.io/Pact Broker/pact-ruby) Sorry for the delay in this, but we have just upgraded the PACT broker to 2.98.0 and re-tested this scenario (adding a new PACT integration to already deployed services) and I can confirm that it is working. Many thanks again.
b
Thanks for letting me know @Paul