Hi guys may I know how I can fix this? ```pact-br...
# general
g
Hi guys may I know how I can fix this?
Copy code
pact-broker can-i-deploy --pacticipant $PACTICIPANT --version $BUILDKITE_COMMIT --to-environment $ENVIRONMENT --retry-while-unknown 30 --retry-interval 10\n'
Waiting for 1 verification result to be published (maximum of 300 seconds)
Computer says no ¯\_(ツ)_/¯
 
CONSUMER                     | C.VERSION  | PROVIDER                     | P.VERSION | SUCCESS? | RESULT#
-----------------------------|------------|------------------------------|-----------|----------|--------
KafkaGenerateKeyPairConsumer | 1bf22d9... | KafkaGenerateKeyPairProvider | ???       | ???      |
 
There is no verified pact between version 1bf22d9a2ff717271268a9934a0099b45e4393a9 of KafkaGenerateKeyPairConsumer and a version of KafkaGenerateKeyPairProvider currently in production (no version is currently recorded as deployed/released in this environment)
🚨 Error: The command exited with status 1
my microservice repo consist of both the provider and consumer does this mean I need publish my provider during my Pull request pipeline in order for the
can-i-deploy
command to work?
y
you need a provider to satisfy the consumer when asking if you can deploy to a particular environment, so if you’ve never deployed the provider before that command above will rightly fail. so yes, you would need to record your provider as deployed. as to exactly when, probably depends more on the specifics of your pipeline, deployment process and repo setup
💯 1
☝️ 1
g
@Yousaf Nabi (pactflow.io) is there a way I can add
KafkaGenerateKeyPairConsumer
and
KafkaGenerateKeyPairProvider
under a participant ? my microservice name is
authn
and I have
KafkaGenerateKeyPairConsumer
and
KafkaGenerateKeyPairProvider
as some of my tests. Im probably going in the wrong direction. so any advise would be appreciated 🙏
m
I don’t follow that question sorry Guo. What do you mean by adding them under a pacticipant?
g
KafkaGenerateKeyPairConsumer
and
KafkaGenerateKeyPairProvider
are my unit tests names but I will have more unit tests in my microservice app do I need to deploy each of them independently like in this repo example? https://github.com/pactflow/example-consumer/blob/master/.github/workflows/build.yml
I guess my question is actually whether I can organised my consumers and providers under a single group?
1
m
The tests should be associated with the applications they represent. i.e. there is a one to many relationship between applications and tests
I guess my question is actually whether I can organised my consumers and providers under a single group?
yes, you should be able to do that
g
do I need to use the broker cli to create a group ? I cant seem to find anything related in the docs
m
no, they should be done on the client side
I’m not super familiar with Pact JVM but I think it’s possible
g
Im using pactjs for my typescript microservice stack do you have a similar example I can refer perhaps?
m
With Pact JS you just put the tests in whatever file you want to group them and it will all be written to the Pact file you specify. You just need to ensure the
consumer
and
provider
names match
g
but when I do a record deployment it seems that I can only specify one pacticipant (sorry if i misunderstood the meaning) which is eg
KafkaGenerateKeyPairProvider
do I have to write script to loop through all participants? do I need to prefix
KafkaGenerateKeyPairProvider
with my microservice name?
m
It’s not usual for a repository to have multiple applications (pacticipants). Usually, each repo represents a single application. Each repo is usually associated with a single build pipeline.
So in your case, you will need to know what you are building and wanting to deploy.
The application in PactFlow should represent what is independently deployed
g
ah looks like I misunderstood the meaning of a pacticipant because my microservice is the application. so I should actually run a record-deployment base on my microservice name
m
so I should actually run a record-deployment base on my microservice name
yes, it would usually be named after the thing that you deploy. There are exceptions (e.g. a monolith with logically different parts), but ignore them until you really know what you’re doing