Use numeric value for pipeline coverage and pipeline coverage delta
What does this MR do and why?
Use numeric value in pipeline coverage to ensure coverage approval rule requirement is not removed when the coverage has decreased.
This fixes bug where pipeline coverage comparison was previously comparing string values, leading to unexpected result in comparison such as '5' < '10'.
As a result, the coverage approval rule requirement was removed even though the coverage has decreased.
Changing to a numeric value requires updating the presentation to format the value into a string with 2 decimals.
Screenshots or screen recordings
How to set up and validate locally
- Create a project with CI pipeline that has a coverage (e.g 10)
test:
stage: test
script:
- echo "Code coverage is 10%"
coverage: '/^Code coverage is ([^%]+)/'
- Enable merge request approval rule for code coverage
- Create a merge request that reduces coverage to single digit that is greater than 1
test:
stage: test
script:
- echo "Code coverage is 9%"
coverage: '/^Code coverage is ([^%]+)/'
- The merge request should require manual approval based on the code coverage rule
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #345386 (closed)
Edited by Albert

