Hi All I am using PACT with Kotlin and Spring Boo...
# general
a
Hi All I am using PACT with Kotlin and Spring Boot and have multiple consumers and providers. The contracts I publish are mapped to specific environments using tags post-deployment. I have the following doubts regarding how PACT verification works across different versions: a. If there is a change in a PACT contract, will it automatically be verified against all existing versions of the provider? b. Similarly, if there is a change in the provider, will PACT verify it against all live consumer versions in any environment? c. Given that I am tagging contracts based on environments post-deployment, how does PACT handle versioning and verification in such scenarios? I want to ensure that backward compatibility is maintained across versions. What is the best approach to managing contract verification when using environment-based tagging? What i feel is if there is any change in provider it will run the provider test against all the consumer versions that are tagged/mapped with different tags/environment. I need some clarification
m
đź‘‹
if you’re just getting started, I would suggest not using tags, and use branches and releases instead.
a. If there is a change in a PACT contract, will it automatically be verified against all existing versions of the provider? You should setup Webhooks to do this. Specifically, this one a. Similarly, if there is a change in the provider, will PACT verify it against all live consumer versions in any environment? You can verify against whatever you wish, but the recommended selectors should do what you want a. Given that I am tagging contracts based on environments post-deployment, how does PACT handle versioning and verification in such scenarios? This is a pretty broad question, but Pact builds up a matrix of data. That data is queried when you make certain calls like
can-i-deploy
. See https://docs.pact.io/pact_broker/advanced_topics/matrix_selectors More generally, you should look at the CI/CD workshop and nirvana guides to get a deeper understanding of how to setup your pipeline. See 👇 (howtolearn)
s
Here are a number of useful hands-on labs that teach all of the key concepts: https://docs.pactflow.io/docs/workshops and https://docs.pact.io/implementation_guides/workshops
a
I have already setup my pipelines to use tags and env, will the provider changes verify against all the different-live consumer by default? I saw the default behaviour and am little confused
m
different-live consumer by default?
only if you use branches and environments
tags don’t mean anything, so the broker doesn’t know what
prod
means - it could be anything.
but it does know if you
record-deployment
for
version
xyz of
application
to
environment
production_,_ what that means
if you use tags, you can use this previous version of the workshop: https://docs.pactflow.io/docs/workshops/ci-cd-legacy