-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visualise software metrics #213
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks already really good!
plugin/src/main/java/io/jenkins/plugins/coverage/metrics/charts/CoverageTrendChart.java
Outdated
Show resolved
Hide resolved
else { | ||
Coverage coverage = (Coverage) value.get(); | ||
return coverage.getCoveredPercentage().toDouble() / 100.0 * 100.0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now this is ok, but in the future it would make more sense to have a specific model for the metrics.
plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageBuildAction.java
Outdated
Show resolved
Hide resolved
@@ -77,7 +77,7 @@ protected LinesChartModel createChartModel(final String configuration) { | |||
var iterable = new BuildActionIterable<>(CoverageBuildAction.class, getLatestAction(), | |||
selectByUrl(), CoverageBuildAction::getStatistics); | |||
|
|||
return new CoverageTrendChart().create(iterable, ChartModelConfiguration.fromJson(configuration)); | |||
return new CoverageTrendChart().create(iterable, ChartModelConfiguration.fromJson(configuration), false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future it makes sense to have a specific trend chart in the job display for metrics as well.
plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageTableModel.java
Show resolved
Hide resolved
plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageTool.java
Outdated
Show resolved
Hide resolved
for (Metric metric: Metric.values()) { | ||
if (text.contains(metric.toTagName())) { | ||
return metric; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be a method in coverage-model.
<div class="row"> | ||
<div class="col-12 py-3"> | ||
<bs:card title="${%Metrics trend}" fontAwesomeIcon="chart-line"> | ||
<div id="metrics-trend" class="graph-cursor-pointer overview-chart h-100"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should only show metrics when we have more than one.
Wouldn't it make more sense if we create a new tab for the metrics, that shows only the metrics overview? Then we show both tabs if we have data for both, and only one tab if there is data from a single category?
...n/src/main/resources/io/jenkins/plugins/coverage/metrics/steps/CoverageViewModel/index.jelly
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #213 +/- ##
============================================
- Coverage 81.90% 79.32% -2.59%
- Complexity 760 797 +37
============================================
Files 47 50 +3
Lines 2658 2858 +200
Branches 253 286 +33
============================================
+ Hits 2177 2267 +90
- Misses 400 513 +113
+ Partials 81 78 -3 ☔ View full report in Codecov by Sentry. |
This adds the extracted metrics from jenkinsci/coverage-model#119 to the web report.
Testing done
Tested with https://github.com/uhafner/warnings-ng-plugin-devenv
Adds a new Report named "Metrics"
The Metrics are show the same as Line Coverage
Submitter checklist