Join Slack
Powered by
Hi, How do we run webhook in <Pact.net> 3x version...
# pact-net
p
Pallavi Anirban Bose
04/14/2023, 10:41 AM
Hi, How do we run webhook in
Pact.net
3x version? So I get data like below from webhook { "pact-consumers":"basketservice", "pact-consumer":"basketservice", "pact-consumer-branch":"master", "pact-consumer-version":"a46900e6f903bb010f614cd67fd6afa64fc6ad69", "pact-provider":"sslpservice", "pact-provider-branch":"master", "pact-provider-version":"be3ea695707268780b5246ab54a1d94b250f582a", "pact-url":"
https://pact-broker.com/pacts/provider/sslpservice/consumer/basketservice/pact-version/78fe8ae578dc3417258241bc76f57985205fc07f/metadata/Y3ZuPWE0NjkwMGU2ZjkwM2JiMDEwZjYxNGNkNjdmZDZhZmE2NGZjNmFkNjkmdz10cnVl
", "pact-verification-result-url":"
https://pact-broker.com/pacts/provider/sslpservice/consumer/basketservice/pact-version/78fe8ae578dc3417258241bc76f57985205fc07f/verification-results/9041
" } Using this I need run the pact provider publish result at pact-verification-result-url. But I'm not sure if it's doable using
pact.net
3x version. Please guide.🙏
y
Yousaf Nabi (pactflow.io)
04/14/2023, 11:26 AM
In your CI system you would check out your provider on that commit sha, or branch, you would then pass your pact url into the verifier, and set publish results to true (if that func was avail in pact-net v3)
Yousaf Nabi (pactflow.io)
04/14/2023, 11:28 AM
example in JavaScript here passing the pact url
https://github.com/pactflow/example-provider/blob/master/src/product/product.consumerChange.pact.test.js#L32
webhook triggered job that uses the information in the webhook payload to checkout the correct version of the provider
https://github.com/pactflow/example-provider/blob/master/.github/workflows/contract_requiring_verification_published.yml#L29-L34
p
Pallavi Anirban Bose
04/14/2023, 5:41 PM
So no need to use pact-verification-result-url anywhere
Open in Slack
Previous
Next