【问题标题】:How can I pass can-i-deploy stage in Gitlab?如何在 Gitlab 中通过 can-i-deploy 阶段?
【发布时间】:2022-01-26 06:44:28
【问题描述】:

它在Pipeline的can-i-deploy阶段给出的错误如下:

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

我没有做任何破坏契约契约的事情。 gitlab-ci.yaml文件中的代码如下:

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

在这张图片中,虽然 pact broker 中有相同版本的 pact 测试,但有两个通过,两个不通过。

这里的主要问题是它应该验证一个协议测试,但它会尝试验证属于该 api 的所有测试。

什么可能导致这个问题,有什么建议吗?我会很高兴的,谢谢!

【问题讨论】:

    标签: go gitlab pact pact-broker


    【解决方案1】:

    试着这样写:

    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

    【讨论】:

      【解决方案2】:

      协议验证是如何完成的?验证失败的细节是什么?提供商团队可能进行了导致此问题的更新。很难从给定的描述中提供适当的答案。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-04-30
        • 1970-01-01
        • 2019-03-22
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-09-22
        • 2022-01-11
        相关资源
        最近更新 更多