Giulio Giovannini
10/21/2024, 2:52 PMcontract_requiring_verification_published
is not firing on my pact broker. I have a consumer and a provider, both with the main branch defined. When I publish a contract for the consumer providing a version and the main branch as the branch, should that not fire?
Instead the publish command outputs: Events detected: contract_published, contract_content_changed (pact content has changed since previous untagged version)
Is this because the contract is untagged? Why is it untagged if I am provided a version and the branch?Giulio Giovannini
10/21/2024, 3:05 PMpact-broker publish pacts/BillingAPI-PlatformAssignmentService.json --consumer-app-version 0000000006 --branch=develop
Yousaf Nabi (pactflow.io)
Use of this webhook requires that:
• 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)
Yousaf Nabi (pactflow.io)
Have the application version number include something that identifies the point in your version control repository that will build this application. For git, it is ideal if you either use the git commit sha (short or long), or include the git commit sha in your version number (for example 0.0.10+76a39e5). This has several advantages:
• The consumer version will definitely change whenever the pact contract changes (satisfying rule 1 above)
Giulio Giovannini
10/21/2024, 3:33 PMcontract_requiring_verification_published
does not fire. BY the way, I am using git SHAs as version umber. The number you see in my example publish command is just me trying manual publishing in order to see what gets triggered. I don't think the pact broker cares about the format of the version number in order to trigger events, correct?Giulio Giovannini
10/21/2024, 3:48 PMcontract_requiring_verification_published
is fired even with a version like "003".Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Giulio Giovannini
10/22/2024, 8:39 AMcontract_published
and contract_content_changed
are triggered but not contract_requiring_verification_published
. According to your link this is to be expected.
• Set a main branch for the provider using pact-broker create-or-update-pacticipant --name=provider02 --main-branch=develop
• Publish new contract with new version and main branch from the consumer: still no contract_requiring_verification_published
triggered. Is this because the provider has the branch but not the version set?
• Set also the version for the provider with call:
curl 'https://<pact broker domain>/pacticipants/provider02/branches/develop/versions/001' -X PUT
• Publish new contract with new version and main branch from the consumer: still no contract_requiring_verification_published
triggered
• Verified contract with call:
curl 'https://<pact broker domain>/pacts/provider/provider02/consumer/consumer02/pact-version/fe43de69914431bcb03717d78de472870e934ef1/metadata/c1tdW2JdPWRldmVsb3Amc1tdW2xdPXRydWUmc1tdW2N2XT05NDAmcD10cnVl/verification-results' -X POST -H "Content-type: application/json" -d '{"success": true, "providerApplicationVersion": "001"}'
• Publish new contract with new version and main branch from the consumer: still no contract_requiring_verification_published
triggered
At this point I have a consumer with main branch and version, a provider with main branch and version, the pact has been verified already. I don't understand what I am missing to have the contract_requiring_verification_published
triggered.
Also the below point does not look not right:
• After publishing I keep getting the message pact content has changed since previous untagged version
related to the triggered events. Why is it saying untagged
when I always provide branch and version of the consumer when publishing?
Also, why the branch of the provider does not appear next to the version that verified the contract?