From 23c0dc91dcfbfab144ab394b42e48be64eb494b9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 18:06:40 +0000 Subject: [PATCH 01/10] Bump dependency edu.hm.hafner:coverage-model to v0.67.0 --- plugin/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/pom.xml b/plugin/pom.xml index 24cb798a..dd51fd34 100644 --- a/plugin/pom.xml +++ b/plugin/pom.xml @@ -35,7 +35,7 @@ false - 0.66.0 + 0.67.0 2.11.0 From e6144d60f2ff8e68b374683b72871df14514cfcb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 18:07:04 +0000 Subject: [PATCH 02/10] Bump dependency edu.hm.hafner:codingstyle-pom to v6 --- ui-tests/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-tests/pom.xml b/ui-tests/pom.xml index 37d713da..6baba4f7 100644 --- a/ui-tests/pom.xml +++ b/ui-tests/pom.xml @@ -5,7 +5,7 @@ edu.hm.hafner codingstyle-pom - 5.42.0 + 6.8.0 From 3f96229114f3f4cce2069d303486be52104a4757 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 18:07:23 +0000 Subject: [PATCH 03/10] Bump dependency org.jvnet.hudson.plugins:analysis-pom to v12 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 796c00c6..410c9061 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jvnet.hudson.plugins analysis-pom - 11.2958.v63511c4c1160 + 12.3140.v667559b_d0470 From b09db42a1892fdf44fa3560dd4e41623a38e7def Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Sat, 11 Apr 2026 00:13:12 +0200 Subject: [PATCH 04/10] Fix PMD warnings --- .../restapi/FileWithModifiedLines.java | 4 +- .../metrics/restapi/ModifiedLinesBlock.java | 6 +-- .../restapi/ModifiedLinesCoverageApi.java | 2 +- .../metrics/source/CoverageSourcePrinter.java | 18 ++++---- .../metrics/source/MutationSourcePrinter.java | 4 +- .../metrics/steps/CodeDeltaCalculator.java | 8 ++-- .../metrics/steps/CoverageTableModel.java | 42 +++++++++---------- .../metrics/steps/CoverageXmlStream.java | 4 +- .../steps/CoverageMetricColumnTest.java | 4 +- 9 files changed, 46 insertions(+), 46 deletions(-) diff --git a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/FileWithModifiedLines.java b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/FileWithModifiedLines.java index d33463e3..838104df 100644 --- a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/FileWithModifiedLines.java +++ b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/FileWithModifiedLines.java @@ -22,12 +22,12 @@ class FileWithModifiedLines { } @Exported(inline = true) - public String getFullyQualifiedFileName() { + String getFullyQualifiedFileName() { return fullyQualifiedFileName; } @Exported(inline = true) - public SortedSet getModifiedLinesBlocks() { + SortedSet getModifiedLinesBlocks() { return modifiedLinesBlocks; } diff --git a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/ModifiedLinesBlock.java b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/ModifiedLinesBlock.java index 86f250e6..a7b9539b 100644 --- a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/ModifiedLinesBlock.java +++ b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/ModifiedLinesBlock.java @@ -24,17 +24,17 @@ class ModifiedLinesBlock implements Comparable { } @Exported - public int getStartLine() { + int getStartLine() { return startLine; } @Exported - public int getEndLine() { + int getEndLine() { return endLine; } @Exported - public LineCoverageType getType() { + LineCoverageType getType() { return type; } diff --git a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/ModifiedLinesCoverageApi.java b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/ModifiedLinesCoverageApi.java index 06087e17..314f8d78 100644 --- a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/ModifiedLinesCoverageApi.java +++ b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/ModifiedLinesCoverageApi.java @@ -25,7 +25,7 @@ class ModifiedLinesCoverageApi { } @Exported(inline = true, name = "files") - public List getFilesWithModifiedLines() { + List getFilesWithModifiedLines() { return filesWithModifiedLines; } diff --git a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/source/CoverageSourcePrinter.java b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/source/CoverageSourcePrinter.java index 3ecce478..8c696a05 100644 --- a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/source/CoverageSourcePrinter.java +++ b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/source/CoverageSourcePrinter.java @@ -48,7 +48,7 @@ class CoverageSourcePrinter implements Serializable { modifiedLines = new TreeSet<>(file.getModifiedLines()); } - public String renderLine(final int line, final String sourceCode) { + String renderLine(final int line, final String sourceCode) { var isPainted = isPainted(line); return tr() .withClasses(isPainted ? getColorClass(line) : UNDEFINED, getModifiedClass(line)) @@ -79,7 +79,7 @@ String getModifiedClass(final int line) { return isModified(line) ? MODIFIED : StringUtils.EMPTY; } - public String getColorClass(final int line) { + String getColorClass(final int line) { if (getCovered(line) == 0) { return NO_COVERAGE; } @@ -91,7 +91,7 @@ else if (getMissed(line) == 0) { } } - public String getTooltip(final int line) { + String getTooltip(final int line) { var covered = getCovered(line); var missed = getMissed(line); if (covered + missed > 1) { @@ -111,7 +111,7 @@ else if (covered == 1) { } } - public String getSummaryColumn(final int line) { + String getSummaryColumn(final int line) { var covered = getCovered(line); var missed = getMissed(line); if (covered + missed > 1) { @@ -120,11 +120,11 @@ public String getSummaryColumn(final int line) { return String.valueOf(covered); } - public final String getPath() { + final String getPath() { return path; } - public boolean isPainted(final int line) { + boolean isPainted(final int line) { return findIndexOfLine(line) >= 0; } @@ -136,11 +136,11 @@ int findIndexOfLine(final int line) { return Arrays.binarySearch(linesToPaint, line); } - public int getCovered(final int line) { + int getCovered(final int line) { return getCounter(line, coveredPerLine); } - public int getMissed(final int line) { + int getMissed(final int line) { return getCounter(line, missedPerLine); } @@ -152,7 +152,7 @@ int getCounter(final int line, final int... counters) { return 0; } - public String getColumnHeader() { + String getColumnHeader() { return StringUtils.EMPTY; } } diff --git a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/source/MutationSourcePrinter.java b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/source/MutationSourcePrinter.java index ea1b6f84..f6293b71 100644 --- a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/source/MutationSourcePrinter.java +++ b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/source/MutationSourcePrinter.java @@ -84,11 +84,11 @@ private List asBulletPoints(final List mutations, final .collect(Collectors.toList()); } - public int getSurvived(final int line) { + int getSurvived(final int line) { return getCounter(line, survivedPerLine); } - public int getKilled(final int line) { + int getKilled(final int line) { return getCounter(line, killedPerLine); } diff --git a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CodeDeltaCalculator.java b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CodeDeltaCalculator.java index 43f59c63..e24d341b 100644 --- a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CodeDeltaCalculator.java +++ b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CodeDeltaCalculator.java @@ -79,7 +79,7 @@ class CodeDeltaCalculator { * * @return the {@link Delta code delta} as Optional if existent, else an empty Optional */ - public Optional calculateCodeDeltaToReference(final Run referenceBuild, final FilteredLog log) { + Optional calculateCodeDeltaToReference(final Run referenceBuild, final FilteredLog log) { return DeltaCalculatorFactory .findDeltaCalculator(scm, build, workspace, listener, log) .calculateDelta(build, referenceBuild, log); @@ -93,7 +93,7 @@ public Optional calculateCodeDeltaToReference(final Run referenceBu * * @return the relevant code changes */ - public Set getCoverageRelevantChanges(final Delta delta) { + Set getCoverageRelevantChanges(final Delta delta) { return delta.getFileChangesMap().values().stream() .filter(fileChange -> fileChange.getFileEditType() == FileEditType.MODIFY || fileChange.getFileEditType() == FileEditType.ADD @@ -116,7 +116,7 @@ public Set getCoverageRelevantChanges(final Delta delta) { * @throws IllegalStateException * when creating the mapping failed due to ambiguous paths */ - public Map mapScmChangesToReportPaths( + Map mapScmChangesToReportPaths( final Set changes, final Node root, final FilteredLog log) throws IllegalStateException { Set reportPaths = new HashSet<>(root.getFiles()); Set scmPaths = changes.stream().map(FileChanges::getFileName).collect(Collectors.toSet()); @@ -150,7 +150,7 @@ public Map mapScmChangesToReportPaths( * @throws IllegalStateException * if the SCM path mapping is ambiguous */ - public Map createOldPathMapping(final Node root, final Node referenceRoot, + Map createOldPathMapping(final Node root, final Node referenceRoot, final Map changes, final FilteredLog log) throws IllegalStateException { Set oldReportPaths = new HashSet<>(referenceRoot.getFiles()); diff --git a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageTableModel.java b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageTableModel.java index b5de9157..1d92b197 100644 --- a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageTableModel.java +++ b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageTableModel.java @@ -222,48 +222,48 @@ static class CoverageRow { colorProvider = colors; } - public String getFileHash() { + String getFileHash() { return String.valueOf(file.getRelativePath().hashCode()); } @SuppressWarnings("PMD.BooleanGetMethodName") - public boolean getModified() { + boolean getModified() { return file.hasModifiedLines(); } - public DetailedCell getFileName() { + DetailedCell getFileName() { return new DetailedCell<>(renderer.renderFileName(file.getName(), file.getRelativePath()), file.getName()); } - public String getPackageName() { + String getPackageName() { return file.getParentName(); } - public DetailedCell getLineCoverage() { + DetailedCell getLineCoverage() { return createColoredCoverageColumn(getCoverageOfNode(Metric.LINE)); } - public DetailedCell getBranchCoverage() { + DetailedCell getBranchCoverage() { return createColoredCoverageColumn(getCoverageOfNode(Metric.BRANCH)); } - public DetailedCell getMethodCoverage() { + DetailedCell getMethodCoverage() { return createColoredCoverageColumn(getCoverageOfNode(Metric.METHOD)); } - public DetailedCell getMcdcPairCoverage() { + DetailedCell getMcdcPairCoverage() { return createColoredCoverageColumn(getCoverageOfNode(Metric.MCDC_PAIR)); } - public DetailedCell getFunctionCallCoverage() { + DetailedCell getFunctionCallCoverage() { return createColoredCoverageColumn(getCoverageOfNode(Metric.FUNCTION_CALL)); } - public DetailedCell getMutationCoverage() { + DetailedCell getMutationCoverage() { return createColoredCoverageColumn(getCoverageOfNode(Metric.MUTATION)); } - public DetailedCell getTestStrength() { + DetailedCell getTestStrength() { return createColoredCoverageColumn(getCoverageOfNode(Metric.TEST_STRENGTH)); } @@ -271,43 +271,43 @@ Coverage getCoverageOfNode(final Metric metric) { return file.getTypedValue(metric, Coverage.nullObject(metric)); } - public DetailedCell getLineCoverageDelta() { + DetailedCell getLineCoverageDelta() { return createColoredFileCoverageDeltaColumn(Metric.LINE); } - public DetailedCell getBranchCoverageDelta() { + DetailedCell getBranchCoverageDelta() { return createColoredFileCoverageDeltaColumn(Metric.BRANCH); } - public DetailedCell getMutationCoverageDelta() { + DetailedCell getMutationCoverageDelta() { return createColoredFileCoverageDeltaColumn(Metric.MUTATION); } - public DetailedCell getTestStrengthDelta() { + DetailedCell getTestStrengthDelta() { return createColoredFileCoverageDeltaColumn(Metric.TEST_STRENGTH); } - public int getLoc() { + int getLoc() { return file.getTypedValue(Metric.LOC, ZERO_LOC).asInteger(); } - public int getTests() { + int getTests() { return file.getTypedValue(Metric.TESTS, ZERO_TESTS).asInteger(); } - public int getCyclomaticComplexity() { + int getCyclomaticComplexity() { return file.getTypedValue(Metric.CYCLOMATIC_COMPLEXITY, ZERO_CYCLOMATIC_COMPLEXITY).asInteger(); } - public int getCognitiveComplexity() { + int getCognitiveComplexity() { return file.getTypedValue(Metric.COGNITIVE_COMPLEXITY, ZERO_COGNITIVE_COMPLEXITY).asInteger(); } - public int getNpathComplexity() { + int getNpathComplexity() { return file.getTypedValue(Metric.NPATH_COMPLEXITY, ZERO_NPATH_COMPLEXITY).asInteger(); } - public int getNcss() { + int getNcss() { return file.getTypedValue(Metric.NCSS, ZERO_NCSS).asInteger(); } diff --git a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageXmlStream.java b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageXmlStream.java index 2b85ca7e..98363efc 100644 --- a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageXmlStream.java +++ b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageXmlStream.java @@ -66,7 +66,7 @@ private static String[] toArray(final String value) { } @VisibleForTesting - public XStream2 getStream() { + XStream2 getStream() { return createStream(); } @@ -169,7 +169,7 @@ protected Entry createMapping(final String key, final String valu * @param * type of the objects that will be marshalled and unmarshalled */ - public static class SimpleConverter implements Converter { + static class SimpleConverter implements Converter { private final Class type; private final Function marshaller; private final Function unmarshaller; diff --git a/plugin/src/test/java/io/jenkins/plugins/coverage/metrics/steps/CoverageMetricColumnTest.java b/plugin/src/test/java/io/jenkins/plugins/coverage/metrics/steps/CoverageMetricColumnTest.java index 9d6e2e54..1872aab6 100644 --- a/plugin/src/test/java/io/jenkins/plugins/coverage/metrics/steps/CoverageMetricColumnTest.java +++ b/plugin/src/test/java/io/jenkins/plugins/coverage/metrics/steps/CoverageMetricColumnTest.java @@ -70,7 +70,7 @@ void shouldAllowEnums() { * @return the created stub */ @VisibleForTesting - public static Job createJobWithActions(final CoverageBuildAction... actions) { + static Job createJobWithActions(final CoverageBuildAction... actions) { Job job = mock(Job.class); Run build = createBuildWithActions(actions); when(job.getLastCompletedBuild()).thenAnswer(a -> build); @@ -86,7 +86,7 @@ void shouldAllowEnums() { * @return the created stub */ @VisibleForTesting - public static Run createBuildWithActions(final CoverageBuildAction... actions) { + static Run createBuildWithActions(final CoverageBuildAction... actions) { Run build = mock(Run.class); when(build.getActions(CoverageBuildAction.class)).thenReturn(Arrays.asList(actions)); if (actions.length > 0) { From f883b426b16d635cf5adb19c7f30e56f38d6b4f2 Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Sat, 11 Apr 2026 13:57:40 +0200 Subject: [PATCH 05/10] Fix PMD and compiler warnings --- plugin/pom.xml | 60 ++++++++++--------- .../metrics/steps/CoverageMetricColumn.java | 3 +- .../metrics/steps/CoverageTokenMacro.java | 6 +- .../threshold/AbstractThreshold.java | 10 ++-- 4 files changed, 41 insertions(+), 38 deletions(-) diff --git a/plugin/pom.xml b/plugin/pom.xml index dd51fd34..c8adb457 100644 --- a/plugin/pom.xml +++ b/plugin/pom.xml @@ -43,6 +43,7 @@ + edu.hm.hafner coverage-model @@ -87,6 +88,7 @@ jsoup + io.jenkins.plugins ionicons-api @@ -96,8 +98,6 @@ token-macro true - - org.jenkins-ci.plugins.workflow workflow-multibranch @@ -149,16 +149,13 @@ io.jenkins.plugins prism-api - 1.30.0-703.v116fb_3b_5b_b_a_a_ - - - io.jenkins.plugins - plugin-util-api - tests - test + org.jenkins-ci.plugins + variant + + org.xmlunit xmlunit-core @@ -191,6 +188,32 @@ + + org.testcontainers + testcontainers + ${testcontainers.version} + test + + + org.apache.commons + commons-compress + + + + + org.testcontainers + junit-jupiter + ${testcontainers.version} + test + + + + + io.jenkins.plugins + plugin-util-api + tests + test + org.jenkins-ci.plugins.workflow workflow-cps @@ -252,7 +275,6 @@ timestamper test - org.jenkins-ci.plugins ssh-credentials @@ -263,24 +285,6 @@ ssh-slaves test - - org.testcontainers - testcontainers - ${testcontainers.version} - test - - - org.apache.commons - commons-compress - - - - - org.testcontainers - junit-jupiter - ${testcontainers.version} - test - io.jenkins configuration-as-code diff --git a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageMetricColumn.java b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageMetricColumn.java index fa839370..2441ef3c 100644 --- a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageMetricColumn.java +++ b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageMetricColumn.java @@ -249,8 +249,7 @@ private static CoverageAppearanceConfiguration getConfiguration(final JenkinsFac /** * Descriptor of the column. */ - @Extension(optional = true) - @Symbol("coverageTotalsColumn") + @Extension @Symbol("coverageTotalsColumn") public static class CoverageMetricColumnDescriptor extends ListViewColumnDescriptor { private final JenkinsFacade jenkins; diff --git a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageTokenMacro.java b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageTokenMacro.java index 5cb8f50b..662d25ff 100644 --- a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageTokenMacro.java +++ b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageTokenMacro.java @@ -7,7 +7,7 @@ import java.util.function.Predicate; import org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro; -import hudson.Extension; +import org.jenkinsci.plugins.variant.OptionalExtension; import hudson.FilePath; import hudson.model.AbstractBuild; import hudson.model.Run; @@ -17,11 +17,11 @@ import io.jenkins.plugins.coverage.metrics.model.ElementFormatter; /** - * Provides a token that evaluates to the number of issues. + * Provides a token that evaluates the number of issues. * * @author Ullrich Hafner */ -@Extension(optional = true) +@OptionalExtension(requireClasses = DataBoundTokenMacro.class) public class CoverageTokenMacro extends DataBoundTokenMacro { private static final ElementFormatter FORMATTER = new ElementFormatter(); static final String COVERAGE = "COVERAGE"; diff --git a/ui-tests/src/main/java/io/jenkins/plugins/coverage/publisher/threshold/AbstractThreshold.java b/ui-tests/src/main/java/io/jenkins/plugins/coverage/publisher/threshold/AbstractThreshold.java index 42407e1e..df3743f6 100644 --- a/ui-tests/src/main/java/io/jenkins/plugins/coverage/publisher/threshold/AbstractThreshold.java +++ b/ui-tests/src/main/java/io/jenkins/plugins/coverage/publisher/threshold/AbstractThreshold.java @@ -32,7 +32,7 @@ protected AbstractThreshold(final PageArea parent, final String path) { * @param threshold * for unhealthy */ - public void setUnhealthyThreshold(final double threshold) { + void setUnhealthyThreshold(final double threshold) { ensureAdvancedOptionsIsActivated(); unhealthyThreshold.set(threshold); } @@ -43,7 +43,7 @@ public void setUnhealthyThreshold(final double threshold) { * @param threshold * for unstable */ - public void setUnstableThreshold(final double threshold) { + void setUnstableThreshold(final double threshold) { ensureAdvancedOptionsIsActivated(); unstableThreshold.set(threshold); } @@ -54,7 +54,7 @@ public void setUnstableThreshold(final double threshold) { * @param failOnUnhealthy * boolean for failing on unhealthy */ - public void setFailUnhealthy(final boolean failOnUnhealthy) { + void setFailUnhealthy(final boolean failOnUnhealthy) { ensureAdvancedOptionsIsActivated(); failUnhealthy.check(failOnUnhealthy); } @@ -62,7 +62,7 @@ public void setFailUnhealthy(final boolean failOnUnhealthy) { /** * Deletes a threshold. */ - public void delete() { + void delete() { ensureAdvancedOptionsIsActivated(); deleteButton.click(); } @@ -70,7 +70,7 @@ public void delete() { /** * Ensures advanced options are activated so that Thresholds can be set. */ - public abstract void ensureAdvancedOptionsIsActivated(); + abstract void ensureAdvancedOptionsIsActivated(); Control getThresholdTarget() { return thresholdTarget; From e71daceb3066ce30c1ef00c8cb790c22a86e6d2a Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Sat, 11 Apr 2026 13:58:10 +0200 Subject: [PATCH 06/10] Fixed PMD false positive --- .../steps/CoverageViewModel/view-model.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/plugin/src/main/resources/io/jenkins/plugins/coverage/metrics/steps/CoverageViewModel/view-model.js b/plugin/src/main/resources/io/jenkins/plugins/coverage/metrics/steps/CoverageViewModel/view-model.js index aa85e112..cb732368 100644 --- a/plugin/src/main/resources/io/jenkins/plugins/coverage/metrics/steps/CoverageViewModel/view-model.js +++ b/plugin/src/main/resources/io/jenkins/plugins/coverage/metrics/steps/CoverageViewModel/view-model.js @@ -1,4 +1,4 @@ -/* global $, proxy, echartsJenkinsApi, bootstrap5 */ +/* global $, proxy, echartsJenkinsApi, bootstrap5, culori */ (function ($) { function fillDialog(trendConfiguration, jsonConfiguration) { @@ -34,7 +34,7 @@ if (colorHex.match(/^#[a-fA-F0-9]{6}$/) !== null) { colorHexMapping.set(jenkinsId, colorHex); } - }) + }); return colorHexMapping; } @@ -42,8 +42,12 @@ return echartsJenkinsApi.resolveJenkinsColor(colorName); } - function printPercentage(value, minimumFractionDigits = 2) { - return Number(value / 100.0).toLocaleString(undefined, {style: 'percent', minimumFractionDigits: minimumFractionDigits}); + function printPercentage(value, minimumFractionDigits) { + const options = { + style: 'percent', + minimumFractionDigits: minimumFractionDigits ? minimumFractionDigits : 2 + }; + return Number(value / 100.0).toLocaleString(undefined, options); } const openBuild = function (build) { // NOPMD @@ -439,7 +443,7 @@ return true; } - return false + return false; } const selectedTabID = 'jenkins-coverage-activeTab'; @@ -595,7 +599,7 @@ else { showNoSelection(); } - }) + }); datatable.on('deselect', function () { showNoSelection(); }); From 69d7d1b0b473f71ed8db2fcc7401842894dd1602 Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Sat, 11 Apr 2026 17:40:11 +0200 Subject: [PATCH 07/10] Bump major version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 410c9061..b89f6fcc 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ - 2 + 3 999999-SNAPSHOT jenkinsci/coverage-plugin From 30fde012098cd6170e6b5944503365c4178cf2ce Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Sun, 12 Apr 2026 10:19:04 +0200 Subject: [PATCH 08/10] Add specific versions for plugin-util --- plugin/pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin/pom.xml b/plugin/pom.xml index c8adb457..abc0ea63 100644 --- a/plugin/pom.xml +++ b/plugin/pom.xml @@ -141,6 +141,7 @@ io.jenkins.plugins plugin-util-api + 7.1320.v684dd26fca_19 io.jenkins.plugins @@ -211,6 +212,7 @@ io.jenkins.plugins plugin-util-api + 7.1320.v684dd26fca_19 tests test From b9f83a16c176fa4a875682af4cda5dde62069c37 Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Sun, 12 Apr 2026 17:55:32 +0200 Subject: [PATCH 09/10] Fix compile errors --- .../publisher/threshold/AbstractThreshold.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ui-tests/src/main/java/io/jenkins/plugins/coverage/publisher/threshold/AbstractThreshold.java b/ui-tests/src/main/java/io/jenkins/plugins/coverage/publisher/threshold/AbstractThreshold.java index df3743f6..55b2990a 100644 --- a/ui-tests/src/main/java/io/jenkins/plugins/coverage/publisher/threshold/AbstractThreshold.java +++ b/ui-tests/src/main/java/io/jenkins/plugins/coverage/publisher/threshold/AbstractThreshold.java @@ -7,7 +7,7 @@ /** * Used for thresholds and global thresholds. */ -abstract class AbstractThreshold extends PageAreaImpl { +public abstract class AbstractThreshold extends PageAreaImpl { private final Control thresholdTarget = control("thresholdTarget"); private final Control unhealthyThreshold = control("unhealthyThreshold"); private final Control unstableThreshold = control("unstableThreshold"); @@ -32,7 +32,7 @@ protected AbstractThreshold(final PageArea parent, final String path) { * @param threshold * for unhealthy */ - void setUnhealthyThreshold(final double threshold) { + public void setUnhealthyThreshold(final double threshold) { ensureAdvancedOptionsIsActivated(); unhealthyThreshold.set(threshold); } @@ -43,7 +43,7 @@ void setUnhealthyThreshold(final double threshold) { * @param threshold * for unstable */ - void setUnstableThreshold(final double threshold) { + public void setUnstableThreshold(final double threshold) { ensureAdvancedOptionsIsActivated(); unstableThreshold.set(threshold); } @@ -54,7 +54,7 @@ void setUnstableThreshold(final double threshold) { * @param failOnUnhealthy * boolean for failing on unhealthy */ - void setFailUnhealthy(final boolean failOnUnhealthy) { + public void setFailUnhealthy(final boolean failOnUnhealthy) { ensureAdvancedOptionsIsActivated(); failUnhealthy.check(failOnUnhealthy); } @@ -62,7 +62,7 @@ void setFailUnhealthy(final boolean failOnUnhealthy) { /** * Deletes a threshold. */ - void delete() { + public void delete() { ensureAdvancedOptionsIsActivated(); deleteButton.click(); } From 327cbbfa13ce3c4a1f89646fffb9902da8f702e6 Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Sun, 12 Apr 2026 21:30:45 +0200 Subject: [PATCH 10/10] Suppress warning --- .../plugins/coverage/publisher/threshold/AbstractThreshold.java | 1 + 1 file changed, 1 insertion(+) diff --git a/ui-tests/src/main/java/io/jenkins/plugins/coverage/publisher/threshold/AbstractThreshold.java b/ui-tests/src/main/java/io/jenkins/plugins/coverage/publisher/threshold/AbstractThreshold.java index 55b2990a..fb385112 100644 --- a/ui-tests/src/main/java/io/jenkins/plugins/coverage/publisher/threshold/AbstractThreshold.java +++ b/ui-tests/src/main/java/io/jenkins/plugins/coverage/publisher/threshold/AbstractThreshold.java @@ -22,6 +22,7 @@ public abstract class AbstractThreshold extends PageAreaImpl { * @param path * to threshold */ + @SuppressWarnings("this-escape") protected AbstractThreshold(final PageArea parent, final String path) { super(parent, path); }