Hi, I have a question, regarding the webhooks desc...
# pact-broker
c
Hi, I have a question, regarding the webhooks described here (https://docs.pact.io/pact_nirvana/step_4#e-configure-pact-to-be-verified-when-contract-changes). Would you rather 1) create a webhook to trigger a generic CI build, that takes the parameters of the pact and figures out which provider build to trigger, or 2) create a webhook for each provider/consumer combination so that the correct provider build is triggered whenever the consumer changes a pact
m
2 is probably simpler, because you don’t need an intermediate process to take the webhook and then work out what to do with it
In a sufficiently standardised pipeline setup, 1 might be preferable though?
c
At what step of the pipeline would you create those webhooks? as part of the consumer pipeline?
m
I would say that the provider owns the webhook. They can choose to create a webhook for all consumers, or just specific ones
Some teams create them manually / separately to pipelines (using the CLI, terraform or UI), and some teams inline them into the pipeline (there is a
create-or-update
webhook command, so that might be appropriate
c
Do you know for the teams that inline them in the pipeline, how they figure out which consumers there are for the provider? via a call to the pact-broker?
m
I suspect that those that want to do it by consumer do it manually, I tend to have provider webhooks pickup any consumer to avoid that problem
c
Ok, so as part of the provider pipeline you configure for all consumers (how do you determine these?) a webhook that triggers the provider build?
m
if you don’t populate the consumer name in the webhook for a provider, it will automatically fire for any existing or new consumer that publishes contracts for that provider
c
I see, thanks for the tip!
👍 1