Hi everyone. I created a hook for "*Contract publi...
# pact-broker
r
Hi everyone. I created a hook for "*Contract published that requires verification*" event but when I publish a new version of contract which hast status ('Unverified') that hook doesn't work out. It triggers only for another event "*Contract published*". Why it doesn't work for "*Contract published that requires verification*"? thanks
m
It presumably doesn't require verification
y
Have you followed the pre-reqs? https://docs.pact.io/pact_broker/webhooks#using-webhooks-with-the-contract_requiring_verification_published-event
Use of this webhook requires that:
• the provider's main branch is configured
• verification results are published with the branch property or you are tagging with the branch name and have automatic branch creation turned on (even if you use trunk based development, and only ever use one branch)
• the exact commit of a provider version can be determined from the version number used to publish the verification results (ie. it either is the commit, or contains the commit as per the Pact Broker version number guidelines)
• any deployments and releases are recorded using the `record-deployment` and `record-release` commands.
☝️ 1
m
What makes you think it should trigger?
this 1
y
if the contents are the same as a previously verified contract, it will automagically be verified by the Pact Broker. providing some more context will help us out 🙂 and therefore you wont get a
contract_requiring_verification_published
event
☝️ 1
r
Thanks guys! will read these docs
👍 1
Now it's working and triggers 2 webhooks at once. It didn't work because I hadn't any providers verification from
Main
branch (master) and had not
record-deployment
thanks. Also I thought main branch value set up by default but when I executed:
Copy code
pact-broker describe-pacticipant --name Foo
it was empty
👍 1
m
If the triggers is the same event, the two triggers will probably differ on the branch/version of the provider to verify (so check the payload).
Good to hear you’re back on track!