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

Conversation

@fo-code
Copy link
Collaborator

@fo-code fo-code commented Feb 1, 2022

Gernerally, some color utility classes have been added that can be used for visualizing coverage.
These classes are already used for visualizing the coverage within the tree map.

Also, provides a customizable dashboard column which can be used to show different coverage metrics of different coverage types of the latest completed build.
The column cell uses colors in order to highlight the coverage values.
The text can be clicked in order to open the coverage report of the latest completed build.

See #206

@codecov
Copy link

codecov bot commented Feb 1, 2022

Codecov Report

Merging #294 (934e4c6) into master (545f0fb) will increase coverage by 2.54%.
The diff coverage is 92.98%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #294      +/-   ##
============================================
+ Coverage     67.56%   70.10%   +2.54%     
- Complexity      595      689      +94     
============================================
  Files            60       73      +13     
  Lines          2454     2713     +259     
  Branches        296      313      +17     
============================================
+ Hits           1658     1902     +244     
- Misses          699      709      +10     
- Partials         97      102       +5     
Impacted Files Coverage Δ
.../model/visualization/dashboard/CoverageColumn.java 69.81% <69.81%> (ø)
...odel/visualization/colorization/CoverageLevel.java 93.93% <93.93%> (ø)
...alization/colorization/CoverageChangeTendency.java 94.11% <94.11%> (ø)
...ns/plugins/coverage/model/CoverageBuildAction.java 74.00% <100.00%> (+9.41%) ⬆️
...jenkins/plugins/coverage/model/CoverageMetric.java 96.15% <100.00%> (+0.07%) ⬆️
...kins/plugins/coverage/model/CoverageViewModel.java 40.40% <100.00%> (+0.60%) ⬆️
...s/plugins/coverage/model/TreeMapNodeConverter.java 100.00% <100.00%> (ø)
...plugins/coverage/model/util/FractionFormatter.java 100.00% <100.00%> (ø)
...rage/model/visualization/colorization/ColorId.java 100.00% <100.00%> (ø)
...odel/visualization/colorization/ColorProvider.java 100.00% <100.00%> (ø)
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 545f0fb...934e4c6. Read the comment docs.

@fo-code
Copy link
Collaborator Author

fo-code commented Feb 2, 2022

Danke @hd42 für den Review!
Ich habe zu den meisten Anmerkungen Anpassungen vorgenommen. Ansonsten siehe Kommentar-Antworten.

@fo-code fo-code changed the title Coverage visualization Coverage dashboard column Feb 5, 2022
fo-code and others added 6 commits February 14, 2022 18:17
# Conflicts:
#	plugin/src/main/java/io/jenkins/plugins/coverage/model/CoverageType.java
#	plugin/src/main/java/io/jenkins/plugins/coverage/model/TreeMapNodeConverter.java
#	plugin/src/main/java/io/jenkins/plugins/coverage/model/util/WebUtils.java
#	plugin/src/main/java/io/jenkins/plugins/coverage/model/visualization/colorization/ColorUtils.java
#	plugin/src/main/java/io/jenkins/plugins/coverage/model/visualization/colorization/CoverageChangeTendency.java
#	plugin/src/main/java/io/jenkins/plugins/coverage/model/visualization/colorization/CoverageColorizationLevel.java
#	plugin/src/main/java/io/jenkins/plugins/coverage/model/visualization/dashboard/CodeCoverageColumn.java
#	plugin/src/main/resources/io/jenkins/plugins/coverage/model/visualization/dashboard/CodeCoverageColumn/column.jelly
#	plugin/src/main/resources/io/jenkins/plugins/coverage/model/visualization/dashboard/CodeCoverageColumn/columnHeader.jelly
#	plugin/src/main/resources/io/jenkins/plugins/coverage/model/visualization/dashboard/CodeCoverageColumn/config.jelly
#	plugin/src/main/resources/io/jenkins/plugins/coverage/model/visualization/dashboard/CodeCoverageColumn/config.properties
#	plugin/src/test/java/io/jenkins/plugins/coverage/model/CoverageBuildActionTest.java
#	plugin/src/test/java/io/jenkins/plugins/coverage/model/CoverageTypeTest.java
#	plugin/src/test/java/io/jenkins/plugins/coverage/model/ResultStubs.java
#	plugin/src/test/java/io/jenkins/plugins/coverage/model/TreeMapNodeConverterTest.java
#	plugin/src/test/java/io/jenkins/plugins/coverage/model/testutil/CoverageStubs.java
#	plugin/src/test/java/io/jenkins/plugins/coverage/model/testutil/JobStubs.java
#	plugin/src/test/java/io/jenkins/plugins/coverage/model/util/WebUtilsTest.java
#	plugin/src/test/java/io/jenkins/plugins/coverage/model/visualization/colorization/ColorUtilsTest.java
#	plugin/src/test/java/io/jenkins/plugins/coverage/model/visualization/colorization/CoverageChangeTendencyTest.java
#	plugin/src/test/java/io/jenkins/plugins/coverage/model/visualization/colorization/CoverageColorizationLevelTest.java
#	plugin/src/test/java/io/jenkins/plugins/coverage/model/visualization/dashboard/CodeCoverageColumnTest.java
@uhafner uhafner added the feature New features label Feb 21, 2022
@fo-code fo-code marked this pull request as ready for review March 9, 2022 09:13
@fo-code fo-code requested a review from uhafner March 9, 2022 09:18
Copy link
Member

@uhafner uhafner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few questions, we can resolve them in a followup PR if required.

Comment on lines +14 to +24
LVL_95(95.0, ColorId.OUTSTANDING),
LVL_90(90.0, ColorId.EXCELLENT),
LVL_85(85.0, ColorId.VERY_GOOD),
LVL_80(80.0, ColorId.GOOD),
LVL_75(75.0, ColorId.ABOVE_AVERAGE),
LVL_70(70.0, ColorId.AVERAGE),
LVL_65(65.0, ColorId.BELOW_AVERAGE),
LVL_60(60.0, ColorId.BAD),
LVL_50(50.0, ColorId.VERY_BAD),
LVL_0(0.0, ColorId.INSUFFICIENT),
NA(-1.0, ColorId.WHITE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it make sense to use a class here so that we make the percentage user configurable?

Copy link
Collaborator Author

@fo-code fo-code Mar 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I also think the colorization should be project specific.

This enum - in long terms - is meant as a fallback colorization when no thresholds have been defined.
For further enhancements, I would suggest another color enum which is used to colorize coverage dependent on the set thresholds (maybe CoverageChangeLevel could be used directly after a rename).
This should act in a similar way, but without any further definitions but the thresholds required.

For example, if the general coverage threshold is 60% and the coverage is 65%, the color should be green for 'good' instead red for 'bad', as provided here.

@fo-code fo-code requested a review from uhafner March 10, 2022 14:57
…used.

(If a localized messsage is stored in a static field then the wrong locale will be used.)
@uhafner uhafner merged commit 31447e6 into jenkinsci:master Mar 10, 2022
@reitzmichnicht
Copy link

Just upgraded to latest jenkins LTS with the newest release of code-coverage plugin and now can not create any views with the coveragecolumn by job-dsl

09:36:23 ERROR: Found multiple extensions which provide method coverageColumn with arguments []: [io.jenkins.plugins.coverage.CoverageColumn, io.jenkins.plugins.coverage.model.visualization.dashboard.CoverageColumn]

  listView("foo") {
    jobs {
      regex("^bar")
    }
    recurse(true)
    columns {
      status()
      weather()
      name()
      lastSuccess()
      lastFailure()
      lastDuration()
      issuesTotalColumn {
        name("# Issues")
      }
      testResult(1)
      coverageColumn()
      buildButton()
    }
  }
}

@uhafner
Copy link
Member

uhafner commented Jun 27, 2022

Can you please create a bug report? Seems that we forgot to delete the old column. Is there a way to specify the class that should be used in JobDSL? The new column is: io.jenkins.plugins.coverage.model.visualization.dashboard.CoverageColumn

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

feature New features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants