Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Convert delta fractions to percentages when used in quality gates #703

Merged
merged 1 commit into from
Jun 4, 2023

Conversation

uhafner
Copy link
Member

@uhafner uhafner commented Jun 4, 2023

Delta values are internally stored as fractions, but a user expects them as percentages when they are displayed or used in thresholds. So values in the range [-1, 1] should be converted to percentages in the range [-100%, 100%] before passed to the quality gate evaluation.

Fixes https://github.com/jenkinsci/code-coverage-api-plugin/issues/689

Delta values are internally stored as fractions, but a user expects
them as percentages when they are displayed or used in thresholds. So
values in the range [-1, 1] are converted to percentages in the range
[-100%, 100%] before passed to the quality gate evaluation.

Fixes https://github.com/jenkinsci/code-coverage-api-plugin/issues/689
@uhafner uhafner added the bug Bugs or performance problems label Jun 4, 2023
@codecov
Copy link

codecov bot commented Jun 4, 2023

Codecov Report

Merging #703 (2c5fefa) into master (353bb57) will increase coverage by 0.16%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master     #703      +/-   ##
============================================
+ Coverage     73.38%   73.54%   +0.16%     
- Complexity     1667     1689      +22     
============================================
  Files           129      130       +1     
  Lines          6240     6278      +38     
  Branches        669      676       +7     
============================================
+ Hits           4579     4617      +38     
  Misses         1439     1439              
  Partials        222      222              
Impacted Files Coverage Δ
...ge/metrics/steps/CoverageQualityGateEvaluator.java 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@uhafner uhafner merged commit 3c7f832 into master Jun 4, 2023
@uhafner uhafner deleted the delta-percentage branch June 4, 2023 13:43
@Jacob-Steele
Copy link
Contributor

Thank you so much @uhafner for the quick fix on this!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bugs or performance problems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Computing Negative Deltas Doesn't Seem to Work
2 participants