Hey there, given a bigger multi-module project wit...
# pact-jvm
g
Hey there, given a bigger multi-module project with multiple consumers and providers, I’d like to have a simple way of tagging the pacticipants after a deploy (everything is deployed together a the same time). I currently have to hard code the list of known pacticipant names and loop over that list, performing something similar to the snippet below:
Copy code
for pacticpant in "${pacticipants}"
do
  pact-cli broker create-version-tag --pacticipant="${pacticipant}" --version="${version}" --tag=${tag}
done
Is there a simpler way of tagging every pacticipant in a Maven project or at least collecting the list of pacticipants?
n
What do you use for the pacticipant names? Could you use the directory structure to get the names instead of hardcoding a list?
g
That's not feasible: we have quite a monolith, which contains different unrelated services. A shared structure would not match the actual domain contexts. We're actually aiming at splitting that monolith, which is why Pacts shall help to increase confidence. I hoped for some tool to extract the pacticipants straight from the sources or rendered Pacts, just like the Maven plugin detects them.
... or the other way around: the Maven plugin might be used to add a tag. I didn't find such a feature, yet, so I'm thinking about a feature request.
n
Does this help? I don’t use the maven plugin https://docs.pact.io/implementation_guides/jvm/provider/maven#plugin-properties
pact.consumer.tags
👀 1
g
I can try - now I'm asking myself, whether the "publish" can happen multiple times with the same version, so that we can have multiple tags (test and production stages). We'll see, thanks for your support!
... also thinking about the scope here: publishing is for the consumer, but we also need to tag the provider names 🤔
m
the
--tag
flag can be specified multiple times, if that’s what you’re asking?
g
@Matt (pactflow.io / pact-js / pact-go) I would need multiple
--pacticipant
flags, so that I wouldn't have to execute the command multiple times, but before doing so I'm still struggling to find an easy way of collecting all pacticipant names in my repo. Maybe I'll try to describe again and you can tell me whether I'm overcomplicating things or overlooked some detail: • We have a Maven multi-module project (400 modules), where some modules are consumers C, and some modules are providers P. • Some C and P have contracts to services outside of the multi-module project. • Publishing C Pacts works, along with the global version of the complete multi-module project, using the Pact Maven plugin. • Verifying for P works as well (via JUnit5 tests). • Releasing/Deploying always deploys every C and P at the same time (did I mention the monolith? 😉 ) for the whole project. • After successful deployment, C and P have to be tagged with the deployed stage, and this is where I'm struggling. • At that step, I know the deployed version and the stage, but I don't know all the names for C and P. I actually never know them at all, because everything is delegated to the Pact libraries/plugins. So, I'd wish for some kind of report or file, where all C and P are collected, maybe as outcome of the publishing and verification steps. I can certainly use the log output, but you certainly agree that this doesn't feel very reliable. To conclude: • Am I missing some detail or do I have to tag the pacticipant version somewhere else? • Is there a convenient tool to collect every pacticipant in a given rep?
... and sorry for the wall of text, I just don't know how to describe the problem in a more concise way.