Hi, anyone using webhook with event contract_requi...
# general
t
Hi, anyone using webhook with event contract_requiring_verification_published? There are lots of webhook triggered by this event type. It doesn't look right to me. As I expected this to trigger only provider main branch pipeline with latest version. Somehow it trigger all version under provider main branch, and I end up getting a bigger list of trigger pipeline day by day. Something definitely wrong here, anyone can help point me to the right direction?
Actually, seem like it create trigger pipeline for all version that has been released in prod "event_name":"contract_requiring_verification_published","provider_version_number":"1.331.0","provider_version_branch":"develop","provider_version_descriptions":["released in prod"]} but that's not I want, I just need it to trigger only latest version 😢
m
Do you genuinely have multiple released versions at the same time, or should you be using deployments instead?
t
@Matt (pactflow.io / pact-js / pact-go) Unfortunately I cannot apply concept of Recording deployments and releases to any of my projects. We automate everything except deployment part. We still deploy product to production manually. So I've never used --environment tag. However, it seem all of that has been tagged with released in prod. How is that possible? btw, if I cannot record deployment and releases. Does that mean I shouldn't use contract_requiring_verification_published at all and fallback to contract_content_changed, right?
m
If you can't automate it, can you not still update Pactflow manually via a CLI call?
And that's correct, probably it's not ideally suited to you. I'd need to re read that article
y
Use of that webhook
contract_requiring_verification_published
requires use of record-deployment and record-release 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.
We would probably need additional context about your setup, how you publish and verify contracts, whether you use branches/tags, what selectors you use for verifying, and when do you verify, and additionally how you record your releases and deployments.
thankyou 2
Unfortunately I cannot apply concept of Recording deployments and releases to any of my projects. We automate everything except deployment part. We still deploy product to production manually.
It is just a cli command, it can be run manually when the deployment is manually performed. (Without knowing the details on this manual deployment its hard to describe any specifics) however from Pact’s perspective its simple. It just needs someone to tell it that x version for y application is deployed to z (undeploying all other versions) or released to z (to sit alongside other versions of the application)
☝️ 1
Also there should be additional information in the webhook passed to your pipeline, in order for your CI system to check out the correct provider builds
A webhook using the
contract_requiring_verification_published
should be configured to pass through the
${pactbroker.pactUrl}
and
${pactbroker.providerVersionNumber}
and
${pactbroker.providerVersionBranch}
to the provider verification build. The Broker then will trigger the execution of the provider version of the main branch, and also the provider version for every environment it has been deployed to, but we need to let our CI application know what versions to build. That’s why the parameters
${pactbroker.providerVersionNumber}
and
${pactbroker.providerVersionBranch}
are needed.
t
Thanks for the context. We are just starting to use contract testing in our company. So there are lots of things that we're still struggling. For now, I decide to just stick with contract_content_change. Anyway thank you so much 🙏
👍 1
y
My pleasure, and no problem, appreciate there is alot to grasp when you are new. Don’t worry though, we are here to help where we can and it is okay to ask questions