:wave: Hi everyone! *Issue with `can-i-deploy` Fa...
# general
a
👋 Hi everyone! Issue with
can-i-deploy
Failing Despite Successful Verification
Context: I am trying to deploy
fastag-api
version
bb7321f7d645718139ea990fd6f9298a1f6272ba
to the
dev-tpi
environment. The contract tests between
fastag-api
and
customer-api
have been successfully verified. What I Observed: 1. Explicit version check works fine: 2. When I run: 1. pact-broker can-i-deploy \ 2. --pacticipant fastag-api --version bb7321f7d645718139ea990fd6f9298a1f6272ba \ 3. --pacticipant customer-api --version 35cfe47bdfaf1030a5e772324a042a439f018928 \ 4. --broker-base-url 5. https://pact-broker.devtools-opt.****.com 6. I get "Computer says yes \o/", confirming that this specific pair is verified. 7. Reverse check also works fine: 1. pact-broker can-i-deploy \ 2. --pacticipant customer-api --version bb7321f7d645718139ea990fd6f9298a1f6272ba \ 3. --pacticipant fastag-api --version 35cfe47bdfaf1030a5e772324a042a439f018928 \ 4. --broker-base-url 5. https://pact-broker.devtools-opt.****.com 6. Again, "Computer says yes \o/", showing the verification is valid both ways. 7. But deployment to
dev-tpi
fails:
1. pact-broker can-i-deploy \ 2. --pacticipant fastag-api --version bb7321f7d645718139ea990fd6f9298a1f6272ba \ 3. --to dev-tpi \ 4. --broker-base-url 5. https://pact-broker.devtools-opt.**.com 6. "Computer says no ¯_(ツ)_/¯", with the message: FYI: 35cfe47bdfaf1030a5e772324a042a439f018928 this version of customer-api is already deployed in dev-tpi environment and also it is tagged/mapped with this environment name 1. There is no verified pact between the latest version of customer-api with tag dev-tpi (35cfe47bdfaf1030a5e772324a042a439f018928) and version bb7321f7d645718139ea990fd6f9298a1f6272ba of fastag-api. Q*uestion:* • Since the verification between
fastag-api
and
customer-api
is already successful, why does
can-i-deploy
fail when using
--to dev-tpi
? • Does the issue relate to tagging? ◦ The error suggests
customer-api
is expected to have a
dev-tpi
tag, but I can confirm that version
35cfe47bdfaf1030a5e772324a042a439f018928
is the one we verified against. ◦ Should I explicitly tag it as
dev-tpi
using
create-version-tag
? • Is there a way to check how
dev-tpi
is being used in the Pact Broker for
customer-api
? Would appreciate any insights on what might be causing this discrepancy. not able to attach the output screen-shot because of company policy :)
m
Are you tagging the versions when you deploy them? They are compatible but when you add the tag into the query they aren't matching indicating they aren't tagged. Tags are the old ways, you should use branches and releases.
Should I explicitly tag it as
dev-tpi
using
create-version-tag
?
Only if you can’t use the environments and branches capability. I’d recommend against the use of tags though, in general
What you should be doing is something like this: 1.
record-deployment --application customer-api --version 35cfe47bdfaf1030a5e772324a042a439f018928 --environment dev-tpi
2. then once it’s deployed
Copy code
pact-broker can-i-deploy \
  --pacticipant fastag-api --version bb7321f7d645718139ea990fd6f9298a1f6272ba \
  --to-environment dev-tpi \
  --broker-base-url
<https://pact-broker.devtools-opt>.****.com
Note the use of
--to-environment
instead of
--to
a
yes I am tagging them post deployment for example here customer api version 35cfe47bdfaf1030a5e772324a042a439f018928 is tagged with dev-tpi Also one more thing to notice when I am running the command
pact-broker can-i-deploy --pacticipant fastag-api --version bb7321f7d645718139ea990fd6f9298a1f6272ba --to-environment dev-tpi --broker-base-url <https://pact-broker.devtools-opt.idfcfirstbank.com>
i am getting this output Computer says no ¯\_(ツ)_/¯ CONSUMER | C.VERSION | PROVIDER | P.VERSION | SUCCESS? | RESULT# ----------------|--------------------------------|--------------|--------------------------------|----------|-------- fastag-api | bb7321f7d645718139ea990fd6f... | customer-api | bb7321f7d645718139ea990fd6f... | true | 1 basically success result is true but computer says no and
There is no verified pact between the latest version of customer-api (bb7321f7d645718139ea990fd6f9298a1f6272ba) and version bb7321f7d645718139ea990fd6f9298a1f6272ba of fastag-api
m
Can you please post the full details with logs? The output isn't quite adding up
Is there a reason why they have the same version? Or is this a typo?
a
both the microservices are in same repository it is possible to have both of them same version[commit id]
Copy code
{
  "providerName": "customer-api",
  "providerApplicationVersion": "bb7321f7d645718139ea990fd6f9298a1f6272ba",
  "success": true,
  "verificationDate": "2025-02-08T13:44:50+00:00",
  "testResults": [
    {
      "interactionId": "3d72a99e7f41b1f469d64551ef3ffe917b7570dc",
      "success": true
    },
    {
      "interactionId": "9df022da269e7dc51961bb98c6f7a4189850ea63",
      "success": true
    }
  ],
  "verifiedBy": {
    "implementation": "Pact-JVM",
    "version": "4.6.10"
  },
  "_links": {
    "self": {
      "title": "Verification result",
      "name": "Verification result 252315 for Pact between fastag-api (bb7321f7d645718139ea990fd6f9298a1f6272ba) and customer-api",
      "href": "<https://pact-broker.devtools-opt>.**.com/pacts/provider/customer-api/consumer/fastag-api/pact-version/b9c560e51cebf1c60d4b452f9097be9f08abbecf/verification-results/252315"
    },
    "pb:pact-version": {
      "title": "Pact",
      "name": "Pact between fastag-api (bb7321f7d645718139ea990fd6f9298a1f6272ba) and customer-api",
      "href": "<https://pact-broker.devtools-opt>.**.com/pacts/provider/customer-api/consumer/fastag-api/pact-version/b9c560e51cebf1c60d4b452f9097be9f08abbecf/metadata/Y3ZuPWJiNzMyMWY3ZDY0NTcxODEzOWVhOTkwZmQ2ZjkyOThhMWY2MjcyYmE"
    },
    "pb:triggered-webhooks": {
      "title": "Webhooks triggered by the publication of this verification result",
      "href": "<https://pact-broker.devtools-opt>.**.com/pacts/provider/customer-api/consumer/fastag-api/pact-version/b9c560e51cebf1c60d4b452f9097be9f08abbecf/verification-results/252315/triggered-webhooks"
    }
  }
}
this is the published result
FYI : both are consumer and provider for each self.
fastag-api is provider for customer -api and customer-api is provider for fastag-api
m
a
but the pact is verified between them I checked on pact broker There is no verified pact between the latest version of customer-api with tag dev-tpi (35cfe47bdfaf1030a5e772324a042a439f018928) and version 031cfd59d4853ceff7c08486b22c420c1891615c of fastag-api this is what log is saying but in pact broker I can see this combination is verified, fastag-api as consumer and customer-api as provider
m
Sorry the last screenshot you provided had another app in it. It's quite hard to provide feedback as things keep moving. My suggestion is to simplify things. Get all the dependencies into an environment (using branches, not tags, ideally). Then make a change to only 1 of them. Even if a pact is verified between two dependencies, pact won't let you deploy both at the same time. It assumes you deploy one at a time and therefore there may be a breaking change for that brief period.