Hi all, QQ, if a consumer uses several providers a...
# pactflow
n
Hi all, QQ, if a consumer uses several providers and then changes their expectations for each one of those providers, in the consumer driven contract testing would that mean that now in the consumer PR we need to checkout each one of those providers and run the verification? I have a flow where when the consumer makes a changes the provider is checkout out in github workflows and the tests are run, then if they pass they can merge to master.
m
would that mean that now in the consumer PR we need to checkout each one of those providers and run the verification?
you normally wouldn’t checkout the provider in the consumer’s build, no (unless you’re doing the webhookless flow). You would normally have the webhook setup to trigger a verification of the pact
n
I was using the webhookless approach and did show it to someone from pact a while back and they mentioned it was fine. But now i'm thinking is the webhooks approach better. And in what way??
I originally saw two approaches one with webhooks and one without. I planned on trying out both, I arbitrarily began with the webhookless flow thats
m
I personally don't like the idea of checking out my provider's code in my consumers build. In some cases / orgs that might be very hard to achieve. If you have transitive dependencies that could get gnarly.
It feels a violation of some sanctified boundary. But I haven't thought too deeply on why I recoil at it by default
n
Yes I definitely see what you mean. However, I am running into a big problem with this flow. Essentially this is my exact current flow of things: 1. Consumer edits/creates pact spec with expectations in branch, pushed code to PR 2. github workflow first runs the pact file and creates a pact out of it if it, and then publishes the pact to pactflow 3. It then checks out the provider branch and runs the verification there and publishes the results 4. It then runs can-i-deploy I see two issues with this flow. 1. The first is, say the consumer developer made a mistake and asked for a field that the provider does not provide. But now the verification failed on the PR and the results were published. Now on the provider side the verification fails and the provider repo is getting failures because the consumer made a mistake. How can we avoid this.. 2. Creating a new contract would fail due to the provider not having verified it yet, and so how could I merge my PR to master with a failing test on my PR?
m
The ci/cd workshop covers this scenario
t
I would definitely not check out the provider's code in the consumer's build. It's unrelated - you don't want the consumer's build to fail if there is some compilation issue (eg a broken master) in another repo. You also don't want the consumer's build to fail if you're not passing provider verification.