Closed JoaoGFarias closed 4 years ago
Did you know you can create a single global webhook that fires for every pacticipant? It seems to me that this would achieve the goal you're after. Can you explain your use case further, if not?
I think this global webhook is exactly what I was looking for.
The problem is that after the contract is created on the Broker, its webhook is in the Create state. So, currently, we are sending two requests per new contract: One to create the webhook and another to add the custom message on the event we want.
This message and event are the same for all our contracts, so the global webhook should be enough. I will try the global option and get back to you.
You can also automate the creation of the webhook like this:
https://github.com/pactflow/example-provider/blob/master/Makefile#L76
Pre issue-raising checklist
I have already (please mark the applicable with an
x
):Software versions
Feature Request
Problem
When many teams new create Pacts in an asynchronous manner, it's common to have many Pacts with webhooks in the Create state; and creating all these webhooks in bulk is a pain, even if you have a script to do such job.
Proposed solution
Have a way to configure the Broker instance so that, following the event of a new Pact creation, it will automatically create a webhook defined globally by the users. Additionally, since webhooks messages usually try to relate to the specific Pact, the custom default webhook would need visibility to the pactBroker variables, such as
pactbroker.providerName
andpactbroker.pactUrl