Stanislav Vodetskyi
07/11/2024, 12:45 AMEvents detected: contract_published (pact content is the same as previous versions with tags and no new tags were applied), contract_requiring_verification_published (pact content is the same as previous versions with tags and no new tags were applied)
Is there a way to see what was the logic that the broker used to decide that contract_requiring_verification_published event happens? What should I look for in the logs?Matt (pactflow.io / pact-js / pact-go)
Stanislav Vodetskyi
07/11/2024, 1:09 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
My guess is that version never verified the contract.or rather, if this isn’t the case, there is a bug somewhere
Stanislav Vodetskyi
07/11/2024, 1:14 AMfake-consumer and itself.
The test isn't changing in months, so the contract should be the same between every push. But when we publish this contract, we use the provider version for the fake-consumer so in the broker we basically have two separate versions for fake-consumer published against different providers from different repos.
And occasionally such publish triggers a webhook. Sometimes it doesn't though. But the contract is the same.
Idk if the above makes sense 😄Stanislav Vodetskyi
07/11/2024, 1:15 AMStanislav Vodetskyi
07/11/2024, 1:16 AMMatt (pactflow.io / pact-js / pact-go)
Stanislav Vodetskyi
07/11/2024, 1:18 AMStanislav Vodetskyi
07/11/2024, 1:19 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Stanislav Vodetskyi
07/11/2024, 9:51 PMcontract_requiring_verification_published (pact content is the same as previous versions with tags and no new tags were applied)
which says that contract requiring verification published, but pact content is the same as previous version. Is this normal/expected?Stanislav Vodetskyi
07/11/2024, 10:06 PMStanislav Vodetskyi
07/11/2024, 10:15 PMfake-consumer version a1 and service-a is published. a1 is the latest version of a fake consumer on master as far as pact-broker is concerned
• service-b builds, a new version of fake-consumer is published - b1 , which does not have a contract with service-a , only with service-b.
• at this point if you hit the pacts/provider/SERVICE-A/for-verification the broker returns an empty list, saying there are no pacts to verify - because the latest version of the fake-consumer does not have a contract with service-a.
• now service-a builds and runs a provider test; it doesn't find any contracts for verification because of the above
• now service-a publishes it's fake-consumer version a2 which at this point is considered a new contract, triggering a webhook.
• the issue is that a2 is not materially different from a1 , but because there was a b1 between them, it's considered new I guess.
I was able to verify the behavior of /for-verification endpoint by publishing a new version of fake-consumer and checking whether service-a or service-b has pacts for verification. Once I pushed a2 manually, it triggered a webhook, even though there was an older version with an identical contract.
So all in all, while this is something that can be fixed on the broker side, it is an edge case that stems from us using an unconventional approach. This will still happen if the team deletes a contract against a provider in version 2 and the reverts it in version 3, but that's probably very rare.
I'm going to try to change self-tests from fake-consumer to using the service name itself like service-a and this should not lead to any webhooks anymore.Matt (pactflow.io / pact-js / pact-go)
Stanislav Vodetskyi
07/11/2024, 11:35 PMStanislav Vodetskyi
07/12/2024, 1:51 AM