Hi All, Looking into webhooks (again). When I pub...
# pactflow
n
Hi All, Looking into webhooks (again). When I publish a consumer in a branch, my webhook triggers to run the provider. But I seem to be getting 2 webhooks firing.
Copy code
[2022-11-09T18:47:44Z] DEBUG: Webhook context {"base_url":"<https://gocity.pactflow.io>","consumer_version_branch":null,"build_url":null,"consumer_version_tags":[],"event_name":"contract_requiring_verification_published","provider_version_number":"0609085aced24bfeaac13a660b9878230d44d197","provider_version_branch":"main","provider_version_descriptions":["latest from main branch"]}
Copy code
[2022-11-09T18:47:47Z] DEBUG: Webhook context {"base_url":"<https://gocity.pactflow.io>","consumer_version_branch":null,"build_url":null,"consumer_version_tags":[],"event_name":"contract_requiring_verification_published","provider_version_number":"562fd7aaa5c45882a8121c9968a32de10c02f983","provider_version_branch":"main","provider_version_descriptions":["deployed in dev","deployed in ext","deployed in production"]}
The different seems to be the
provider_version_descriptions
-is there any documentation on this?
n
Could it be that one is for the provider in the main branch and the other for the provider that is deployed to an environment such as production? On the pact docs it states that the
contract_requiring_verification_published
"""" triggers once for each of the following provider versions that are missing a verification result for the newly published pact: • the latest version from the provider's main branch • any version currently deployed to an environment """
b
It is exactly what Noor says.
The other difference is the provider_version_number
Copy code
0609085aced24bfeaac13a660b9878230d44d197
is latest from main branch
Copy code
562fd7aaa5c45882a8121c9968a32de10c02f983
is deployed in dev”,“deployed in ext”,“deployed in production”
It’s doing exactly what it’s meant to be doing.
You need a build that checks out the correct git SHA now, to run the pact tests.
Docs https://github.com/pact-foundation/pact_broker/blob/master/lib/pact_broker/doc/views/webhooks.markdown#dynamic-variable-substitution • `${pactbroker.providerVersionDescriptions}`: The descriptions of the provider version(s) for which the contract_requiring_verification_published webhook has been triggered. Only populated for the contract_requiring_verification_published event.