Gitlab 管道 - 报告配置包含未知密钥:cobertura

Gitlab pipeline - reports config contains unknown keys: cobertura

由于这个错误,我无法 运行 gitlab 管道

Invalid CI config YAML file
jobs:run tests:artifacts:reports config contains unknown keys: cobertura

GitLab 已删除 Cobetura 报告。

来自他们的15.0 release notes

We are reducing the number of analyzers used in GitLab SAST as part of our long-term strategy to deliver a better and more consistent user experience. Streamlining the set of analyzers will also enable faster iteration, better results, and greater efficiency (including a reduction in CI runner usage in most cases).

你可以看到 commit here

在此处查看最新的正确文档:https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html#artifactsreportscoverage_report

由于提到的新版本,一些文档目前处于有些混乱的状态。

这是我的解决方法:

  artifacts:
    expire_in: 2 days
    reports:
      coverage_report:
        coverage_format: cobertura
        path: python_app/coverage.xml