Skip to content

Document precedence of coverage regex

Nourdin el Bacha requested to merge document-precedence-coverage-regex into master

What does this MR do and why?

This documents the precedence of coverage_regex, as well as elaborate on using the API to declare the coverage_regex.

I think that the .gitlab-ci.yml declared coverage takes precedence due to the follow two methods:

app/models/ci/build.rb#L871-873:

  def coverage_regex
    super || project.try(:build_coverage_regex)
  end

and lib/gitlab/ci/yaml_processor/result.rb#L61-71:

def build_attributes(name)
  job = jobs.fetch(name.to_sym, {})

  { stage_idx: stages.index(job[:stage]),
    ...
    coverage_regex: job[:coverage],
    ...

Describe in detail what your merge request does and why.

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports