Hello! We are seeing an oddity within Pactflow and...
# pactflow
t
Hello! We are seeing an oddity within Pactflow and hoping to get some help. We have a pact between two services. The pact exists in Pactflow (attached picture). However when running provider verification, we are getting a
NoPactsFound
exception (JVM Library). Digging into the code, the library is using the following endpoint
/pacts/provider/<provider>/for-verification
. This endpoint has no pacts on it. Any ideas on why this might be?
Tagging @MiKey @Jacob Brauchler
y
Hey, is that consumer branch the only pact that has been published? Note it is not the main branch, nor deployed to an environment, nor has tags. On the provider side for verification, what consumer version selectors are you using to retrieve the pacts for verification? https://docs.pact.io/pact_broker/advanced_topics/consumer_version_selectors There are two verifications of pacts on the provider side, which provider verification task are you referring too? https://docs.pact.io/pact_nirvana/step_4#verifying-pacts
1. When the provider code changes
• The verification task will run as part of the normal CI/CD pipeline for the provider
• The verification task will fetch and verify all the relevant pacts from all consumers from the Pact Broker to ensure no regressions have occurred.
2. When the pact changes
• We recommend that a separate pipeline is set up to verify just the changed pact (more details on this later in the guide).
You would traditionally have a webhook, setup on new contracts, or contracts being changed that would trigger a provider verification with a pactUrl directly https://docs.pact.io/pact_broker/webhooks#the-contract-requiring-verification-published-event
👀 1
t
For this specific pact, this is the first time publishing and trying to verify it. We have other examples that work. The difference between this one and the working pact is: • this is a Pact v4 spec contract (the working one is v2) • this is a message based contract (the working one is HTTP based)
Picture to help
h
Yeah, I'd be curious as to your ConsumerVersionSelectors too. I'm not certain, but it feels like a WIP pact since it is still on a consumer branch. A couple things come to mind from my experience: • ConsumerVersionSelector:
MatchingBranch: true
with provider branch
PE-354
• VerifyRequest config ◦
IncludeWIPPactsSince: [date]
EnablePending: true
I dont use tags and opt for branches instead and seeing as how you dont tag, that might fix it. fingerscrossed
m
There are no version selectors yet, we typically don't add version selectors until the contract is published in all of our environments. Pending pacts are set to true on the provider verification
b
The ‘pacts for verification’ endpoint requires a post with a body, where the body contains the consumer version selectors.
You need to publish your pact with a branch set.
and then you need to either select the branch with the selectors on the provider side, or turn on wip pacts.
Doing a GET to the endpoint will not provide you with what you want. You can see the actual request the provider is making if you turn on http debug logging.