Skip to content

Coverage check approval rule is ignored

Summary

Merge requests with decreased code coverage do not require approval before merging even if a coverage check approval ruleis configured.

Steps to reproduce

  1. Create a new project under a PREMIUM license
  2. Enable the coverage check approval rule for all branches and with one approval required by a user that is not me.

Screen_Shot_2021-11-10_at_14.40.23

  1. Add a gitlab-ci.yml with code coverage and configuration for the extraction
test:
  stage: test
  script:
    - echo "Code coverage is 10%"
  coverage: '/^Code coverage is ([^%]+)/'
  1. Create a merge request decreasing the reported code coverage by the test job

Screen_Shot_2021-11-10_at_14.44.39

Example Project

https://gitlab.com/newcubator/coverage-approval-rule-test

What is the current bug behavior?

The merge request can be merged by myself and no approval is required although a decrease in code coverage is listed in the mr.

Screen_Shot_2021-11-10_at_14.46.21

What is the expected correct behavior?

Merging the MR by myself should not be possible and the button should be disabled until the mr gets a approval by the configured user in the coverage check approval rule.

Output of checks

This bug happens on GitLab.com

Edited by Jan Sauer