Hey folks, a question on webhooks. Normally `contr...
# pact-broker
s
Hey folks, a question on webhooks. Normally
contract_requiring_verification_published
webhook is triggered when the pact is published. Is it possible to also trigger it from
can-i-deploy
if verification result is missing? The reason for that is that if for whatever reason the original webhook (from publish time) didn't go through (e.g. webhook receiver service was down or something) and we're missing verification results it would be good to try again come deploy time rather than just failing right away. Is there a way to re-trigger this event manually?
m
Not from that command, sorry.
Just thinking about how you might achieve it
There is a “hidden” feature of the
pact-broker
command that checks if a verification is required. You could potentially run that on a “cron” like build, but probably it wouldn’t solve your problem as you’d need to run it for each deployed version and for main - a bit messy. But just in case, this is how we run it in our build pipeline (you can hopefully extrapolate here):
Copy code
docker run --rm \
      -e PACT_BROKER_BASE_URL=$PACT_BROKER_BASE_URL \
      -e PACT_BROKER_TOKEN=$PACT_BROKER_TOKEN \
      -e PACT_BROKER_FEATURES="verification_required" \
      -it \
      pactfoundation/pact-cli:$PACT_CLI_VERSION \
          broker verification-required \
          --pacticipant pactflow-application-saas \
          --version ${RELEASE_VERSION} \
          --pacticipant ${CONSUMER_NAME} \
          --version ${CONSUMER_VERSION_NUMBER} \
          --verbose
You could use that to determine whether or you need to run a verification and if so, kick it off
thankyou 2 1