Mayank Chugh
03/02/2023, 10:23 AMcontract_requiring_verification_published
is being fired even when there is no change in the contract from last ālatestā published contractMayank Chugh
03/02/2023, 10:23 AM--consumer-app-version=${{git.sha}} --broker-token=${PACT_BROKER_TOKEN} --branch=${{ github.head_ref || github.ref_name }}
3. Provider runs the verification by pulling latest: true contracts
4. Provider publishes the contract verification results with providerBranch: ${PACT.mainBranch}
Mayank Chugh
03/02/2023, 10:25 AMMayank Chugh
03/02/2023, 10:27 AMconsumer-app-version
changes as per new Git commit and --branch
also changes
The following events are still fired:
Events detected: contract_published, contract_requiring_verification_published, contract_content_changed (pact content has changed since previous untagged version)
Webhook "Contract verification required " triggered for event contract_requiring_verification_published.
Mayank Chugh
03/02/2023, 10:30 AMMayank Chugh
03/02/2023, 10:32 AM⢠If the relevant consumer version has any tags, then for each tag, check if the content is different from the previous latest version for that tag. It is āchangedā if any of the checks are true. One side effect of this is that brand new tags will trigger a pact changed event, even if the content is the same as a previous version.
⢠If the relevant consumer version has no tags, then check if the content has changed since the previous latest version.
I was expecting the
contract_content_changed
event to not fire because even though I have not supplied any ātagsā, the content is same as the previous latest (and verified) pact.Mayank Chugh
03/02/2023, 10:34 AMcontract_requiring_verification_published
event to trigger the provider tests. However, since the event is fired even when the contract content is not changed, it defeats the purpose in my implementation.Mayank Chugh
03/02/2023, 10:34 AMMayank Chugh
03/02/2023, 10:35 AMmainBranch
for provider and consumer has been set as trunk
. using pact-broker create-or-update-pacticipant
. The last verified pact was from providerBranch = trunk
and the content of consumer contract did not change in the next publishMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
If the relevant consumer version has any tags, then for each tag, check if the content is different from the previous latest version for that tag. It is āchangedā if any of the checks are true. One side effect of this is that brand new tags will trigger a pact changed event, even if the content is the same as a previous version.
Matt (pactflow.io / pact-js / pact-go)
Mayank Chugh
03/02/2023, 12:25 PMid
field in the response.
It was an oversight on my part. My apologies sorry
However, this makes me think that using fixture generators to create the sample response could be a popular use case. I am sure a lot of teams would like to use the same response as test data in their unit/functional and contract tests to reduce maintainability.
I wonder how can Pact Broker be further improved to consider:
Like({ id: integer(10) }) === Like({id: integer(11)})
and not trigger contract_changed
event. Or, maybe trigger contract_changed
but does not trigger contract_requiring_verification_published
eventMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Mayank Chugh
03/02/2023, 12:46 PMBeth (pactflow.io/Pact Broker/pact-ruby)
@Beth (pactflow.io/Pact Broker/pact-ruby) are you able to confirm if branches will behave like tags in this instance?Wow. This is greatly embarrassing. I think that logic needs updating for branches.
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
contract_requiring_verification_published
Beth (pactflow.io/Pact Broker/pact-ruby)
contract_content_changed
Beth (pactflow.io/Pact Broker/pact-ruby)