code-coverage-api-plugin
code-coverage-api-plugin copied to clipboard
Show trend chart on details view only if there are at least 2 builds
UI improvement for https://github.com/jenkinsci/code-coverage-api-plugin/pull/203

Hello @uhafner Can you guide me on how to approach this issue?
There needs to be an if guard around https://github.com/jenkinsci/coverage-plugin/blob/ee3e8c2926bef8c4efd3da68445795d38dd6b6e1/plugin/src/main/resources/io/jenkins/plugins/coverage/metrics/steps/CoverageViewModel/index.jelly#L56.
In the CoverageViewModel an associated boolean method needs to be added if not already there. (On the action we have it already.)
Please note that I am currently moving the code of this plugin to https://github.com/jenkinsci/coverage-plugin. So the PR needs to go on that plugin. The code-coverage-api plugin will be end-of-life soon. All code has been moved to https://github.com/jenkinsci/coverage-plugin.
There needs to be an
ifguard around https://github.com/jenkinsci/coverage-plugin/blob/ee3e8c2926bef8c4efd3da68445795d38dd6b6e1/plugin/src/main/resources/io/jenkins/plugins/coverage/metrics/steps/CoverageViewModel/index.jelly#L56.In the
CoverageViewModelan associated boolean method needs to be added if not already there.
Thanks, I understood the approach of checking the value of no. of builds (at least 2) by adding a boolean method in the CoverageViewModel.java file and showing the trend chart as per the output (true/false).
(On the action we have it already.)
Sorry, but I didn't get you here. Is this kind of method already implemented?
Please note that I am currently moving the code of this plugin to https://github.com/jenkinsci/coverage-plugin. So the PR needs to go on that plugin. The code-coverage-api plugin will be end-of-life soon. All code has been moved to https://github.com/jenkinsci/coverage-plugin.
Ohk...Thanks for the update.
There needs to be an
ifguard around https://github.com/jenkinsci/coverage-plugin/blob/ee3e8c2926bef8c4efd3da68445795d38dd6b6e1/plugin/src/main/resources/io/jenkins/plugins/coverage/metrics/steps/CoverageViewModel/index.jelly#L56. In theCoverageViewModelan associated boolean method needs to be added if not already there.Thanks, I understood the approach of checking the value of no. of builds (at least 2) by adding a boolean method in the
CoverageViewModel.javafile and showing the trend chart as per the output(true/false).(On the action we have it already.)
Sorry, but I didn't get you here. Is this kind of method already implemented?
The CoverageAction (that creates the CoverageViewModel) has a CoverageProjectAction with the method isTrendVisible(). This value needs to be used as a property for view model. It would make sense to use a new enum {DRAW_TREND, HIDE_TREND} in the constructor of the CoverageViewModel.
Please note that I am currently moving the code of this plugin to https://github.com/jenkinsci/coverage-plugin. So the PR needs to go on that plugin. The code-coverage-api plugin will be end-of-life soon. All code has been moved to https://github.com/jenkinsci/coverage-plugin.
Ohk...Thanks for the update.