Rubén Pérez
09/16/2022, 10:37 AMcontract_requiring_verification_published event), that triggers the needed provider builds once a contract change is detected. As a parameter, it sends the URL of the pact version to verify.
Also, in our JVM provider applications so far we have set the consumer version selectors in Gradle, so that the versions to verify are the latests from the main branch and the latests deployed/released. In our case using the workaround rawjson, given that the @ConsumerVersionSelector annotation didn't support branches or deployments.
So my question is how do I let Pact know in my provider code that when the build has been triggered by the Broker, what I need to check is the pact version that the webhook has sent instead of the one defined in the rawjson property?uglyog
@AllowOverridePactUrl annotation. See https://github.com/pact-foundation/pact-jvm/blob/master/provider/junit/README.md#allowing-just-the-changed-pact-s[…]-in-a-webhook-to-be-verified-406Rubén Pérez
09/19/2022, 6:36 AMpact.filter.pacturl and pact.filter.consumers the same way I'm adding the others as system properties. My guess is that the pact.filter.consumers will always have value (I know its value beforehand), but the pact.filter.pacturl will only have a proper value when an actual webhook execution has triggered that provider build. And if that property doesn't have a proper value, then a "normal" build will be executed, using the consumer selector logic that normally applies.
Is that right?uglyog
pact.filter.pacturl set to the webhook URL.uglyog
uglyog
pact.filter.pacturl is not set, it will run as normalRubén Pérez
09/19/2022, 6:45 AMpact.filter.consumers is helpful then when we have a provider that has many consumers, so that a contract change only triggers the tests of the proper consumer instead of running all the tests with that pactUrl.
Makes a lot of sense 🙂Rubén Pérez
09/19/2022, 6:46 AM