Provider verification for a tagged consumer is resulting in verification for other tagged consumers than what is requested for
sanjimoh opened this issue · 3 comments
In my setup, I've a consumer viz. "test-consumer" publishing it's pact with consumer version "4.0.0" along with tag "sanjit-feature-branch".
When I run my provider side of test case passing consumer tag as "sanjit-feature-branch", I'm noticing the verification results are being verified and published for not only consumer tagged with "sanjit-feature-branch" but also for other consumer versions having other tags like "production" and "latest". Unfortunately this is not what I intend to achieve.
Is it a bug? or some missing settings? I'm using pact-go library which internally uses the pact-foundation standalone ruby libraries. At least from the pact-go debug logs, I'm able to verify that it is able to identify consumer pact with version "4.0.0" but still the verification is happening for all other tagged consumer versions.
For your reference, following is the command which pact-go is implicitly trying to execute for provider verification as well as publishing the verification result to pact-broker -
pact-provider-verifier http://localhost:8080/pacts/provider/test-provider-rest/consumer/test-consumer-rest/version/4.0.0 --format json --provider-base-url http://127.0.0.1:39678 --provider-states-setup-url http://127.0.0.1:39678/setup --provider_app_version 2.0.3 --publish_verification_results true
Is the content of each of these pacts the same? Verifications are attached to the content, not to the version number, so if your sanjit-feature-branch pact has the same content as pacts with different tags, those ones get verified too (they're all the same content). This may answer your question https://docs.pact.io/getting_started/versioning_in_the_pact_broker
Yes, the pact contents are exactly the same across those tags. Once the pact differs in their contents, then only the requested tag gets verified not all. So, as I understand, this behavior is as per the design. Thanks!
Yes, it is.