Home > Software engineering >  How can I pass can-i-deploy stage in Gitlab?
How can I pass can-i-deploy stage in Gitlab?

Time:12-30

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: 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

In this image, although there are pact tests in the same version in pact broker, two pass and two do not.

enter image description here

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!

CodePudding user response:

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

CodePudding user response:

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.

  • Related