Nick Meyer
05/22/2023, 4:50 PMYousaf Nabi (pactflow.io)
--retry-while-unknown 6 --retry-interval 10
which gives time for the triggered verification run to have taken placeNick Meyer
05/22/2023, 5:37 PMwebhooks I already use the contract_requiring_verification_published webhook, however we occasionally have a race condition where a new consumer version will be deployed while a provider is going through the pipeline, so the end result is when the provider hits its deploy, the deploy fails because the two versions never lined up.
Are there distinct error codes for outright failure vs no verification result that could be keyed into to trigger a verification?Matt (pactflow.io / pact-js / pact-go)
can-i-deploy should run immediately before a deployment - are you saying a race condition is happening there? If there is a big gap between can-i-deploy and deploy that’s probably worth addressing firstNick Meyer
05/23/2023, 3:34 PMcan-i-deploy is happening immediately before deploy in the pipeline.
The race condition I’m describing is with verification. e.g.:
Consumer X v1 and Provider Y v1 are currently deployed. Commits are made to both and the pipelines are running concurrently. Provider Y v2 runs verification against Consumer X v1 in its pre-deploy pipeline, Consumer X publishes its Pact for v2, which triggers a verification webhook against Provider Y v1, which is the currently deployed version. That verification passes, and Consumer X v2 passes the can-I-deploy check and is deployed.
Now Provider Y runs a can-i-deploy check for v2 which fails because Consumer X v2 is now deployed, and has not been verified against Provider Y v2, due to v1 being the deployed version at the time the consumer pipeline triggered the verification webhook, and Consumer X v1 being the deployed version when the provider pipeline ran its own verification.Nick Meyer
05/23/2023, 3:56 PM