Hey everyone :wave: I ran into something with Pact...
# general
a
Hey everyone 👋 I ran into something with Pact Broker and monorepos, and wanted to check how others are handling this. We have a pretty typical setup: • 1 consumer app • A provider that lives in a monorepo, split into multiple microservices In Pact Broker, those microservices show up as separate provider pacticipants (we currently have 4). The issue is: Whenever a contract changes, Pact Broker triggers a webhook for each provider pacticipant — so we end up with 4 webhook calls. All of them hit the same CI pipeline, which means the exact same pipeline runs 4 times in parallel 😅 What we’re trying to achieve is basically: → run the pipeline once per contract change, not once per provider Right now we’re handling it on the CI side (Azure DevOps concurrency / locks), and also considering putting a small webhook gateway in front to deduplicate events. But I was wondering: Is there any Pact-native way of dealing with this in a monorepo setup? Or is the general expectation to handle this kind of deduplication outside of Pact? Curious how others approached this in real projects 🙏 Thanks!
m
Sorry for the delay, I thought I had responded to this. When the webhook fires to your provider CI, it should contain both the provider name, version and (if you like) branch. You can (and should) use this information to run the specific build you need.
I’m not aware of any other way to avoid duplicates:
→ run the pipeline once per contract change, not once per provider
I think the best you can get from PactFlow is “once per contract change per provider_”_
a
Thank you very much.
cool doge flip 1