How can I pass can-i-deploy stage in Gitlab?

208 Views Asked by At

The error it gives in the can-i-deploy stage in the Pipeline is as follows:

The verification between the latest version of BusinessEventConsumerCustomerConsentionPhoneCall with tag phoenix (fd53a677) and version 002bf857 of EarningAPI failed

I didn't do anything to break the pact contract. The code in the gitlab-ci.yaml file is as follows:

pact-can-i-deploy-to-phoenix:
  stage: pact-can-i-deploy-to-phoenix
  image: ...
  script:
    - pact-broker can-i-deploy --pacticipant DenemeAPI --version $CI_COMMIT_SHORT_SHA --to phoenix --retry-while-unknown=12 --retry-interval=10
  except:
    - triggers
  tags:
    - customer

pact-tag-for-phoenix:
  stage: pact-tag-for-phoenix
  image: ...
  script:
    - pact-broker create-version-tag --pacticipant DenemeAPI --version $CI_COMMIT_SHORT_SHA --tag=phoenix
  except:
    - triggers
  tags:
    - customer

The main problem here is that it should verify one pact test, but it tries to verify all the tests belonging to that api.

What could be causing this issue, any suggestions? I would be very pleased, thank you!

2

There are 2 best solutions below

0
suitemod On

Try to write like this:

stages:
    - pact-can-i-deploy-to-phoenix
    - pact-tag-for-phoenix
    
pact-can-i-deploy-to-phoenix:
  stage: pact-can-i-deploy-to-phoenix
  image: registry.gitlab.com/modanisatech/customer/docker-images/pact-cli/master:latest
  script:
    - pact-broker can-i-deploy --pacticipant EarningAPI --version $CI_COMMIT_SHORT_SHA --to phoenix --retry-while-unknown=12 --retry-interval=10
  except:
    - triggers
  tags:
    - customer

pact-tag-for-phoenix:
  stage: pact-tag-for-phoenix
  image: registry.gitlab.com/modanisatech/customer/docker-images/pact-cli/master:latest
  script:
    - pact-broker create-version-tag --pacticipant EarningAPI --version $CI_COMMIT_SHORT_SHA --tag=phoenix
  except:
    - triggers
  tags:
    - customer

0
Syed Muhammad Dawoud Sheraz On

How is the pact verification done? What are the details of the failed verification pacts? It is possible the provider team might have made an update that caused this issue. It is difficult to provide an appropriate answer from the given description.