From e71ae0a4a6ecab9660b664fa5794b46e221a9a4e Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Thu, 18 Aug 2022 12:27:23 +0200 Subject: [PATCH] Add a new ionicons symbol for the actions. Requires a bump of Jenkins baseline to 2.346.3. --- plugin/pom.xml | 8 +++ .../coverage/model/CoverageBuildAction.java | 6 +-- .../coverage/model/CoverageJobAction.java | 2 +- .../model/CoverageBuildAction/summary.jelly | 2 +- plugin/src/main/webapp/icons/LICENSE.txt | 3 -- plugin/src/main/webapp/icons/coverage.svg | 46 ---------------- .../BlockSlaveToMasterFileCallable.java | 52 ------------------- 7 files changed, 13 insertions(+), 106 deletions(-) delete mode 100644 plugin/src/main/webapp/icons/LICENSE.txt delete mode 100644 plugin/src/main/webapp/icons/coverage.svg delete mode 100644 plugin/src/test/java/io/jenkins/plugins/coverage/BlockSlaveToMasterFileCallable.java diff --git a/plugin/pom.xml b/plugin/pom.xml index 71a50b72c..3f5c172a7 100644 --- a/plugin/pom.xml +++ b/plugin/pom.xml @@ -23,6 +23,9 @@ -SNAPSHOT jenkinsci/code-coverage-api-plugin + 2.346 + 2.346.3 + 3.0.3 11.4 @@ -57,6 +60,11 @@ + + io.jenkins.plugins + ionicons-api + 22.v868b_0c347756 + net.sf.trove4j trove4j diff --git a/plugin/src/main/java/io/jenkins/plugins/coverage/model/CoverageBuildAction.java b/plugin/src/main/java/io/jenkins/plugins/coverage/model/CoverageBuildAction.java index 76bce08cf..9250052d7 100644 --- a/plugin/src/main/java/io/jenkins/plugins/coverage/model/CoverageBuildAction.java +++ b/plugin/src/main/java/io/jenkins/plugins/coverage/model/CoverageBuildAction.java @@ -36,7 +36,7 @@ public class CoverageBuildAction extends BuildAction implements He /** Relative URL to the details of the code coverage results. */ public static final String DETAILS_URL = "coverage"; /** The coverage report icon. */ - public static final String SMALL_ICON = "/plugin/code-coverage-api/icons/coverage.svg"; + public static final String ICON = "symbol-footsteps-outline plugin-ionicons-api"; private static final long serialVersionUID = -6023811049340671399L; @@ -123,7 +123,7 @@ public CoverageBuildAction(final Run owner, final CoverageNode result, lineCoverage = result.getCoverage(CoverageMetric.LINE); branchCoverage = result.getCoverage(CoverageMetric.BRANCH); - this.difference = delta; + difference = delta; this.changeCoverage = changeCoverage; this.changeCoverageDifference = changeCoverageDifference; this.indirectCoverageChanges = indirectCoverageChanges; @@ -523,7 +523,7 @@ public CoverageViewModel getTarget() { @CheckForNull @Override public String getIconFileName() { - return SMALL_ICON; + return ICON; } @NonNull diff --git a/plugin/src/main/java/io/jenkins/plugins/coverage/model/CoverageJobAction.java b/plugin/src/main/java/io/jenkins/plugins/coverage/model/CoverageJobAction.java index f9afb4257..20157307d 100644 --- a/plugin/src/main/java/io/jenkins/plugins/coverage/model/CoverageJobAction.java +++ b/plugin/src/main/java/io/jenkins/plugins/coverage/model/CoverageJobAction.java @@ -26,7 +26,7 @@ public class CoverageJobAction extends AsyncConfigurableTrendJobAction - + diff --git a/plugin/src/main/webapp/icons/LICENSE.txt b/plugin/src/main/webapp/icons/LICENSE.txt deleted file mode 100644 index 0fe96e107..000000000 --- a/plugin/src/main/webapp/icons/LICENSE.txt +++ /dev/null @@ -1,3 +0,0 @@ -License for FontAwesome icons: - -https://fontawesome.com/license diff --git a/plugin/src/main/webapp/icons/coverage.svg b/plugin/src/main/webapp/icons/coverage.svg deleted file mode 100644 index d6bf45600..000000000 --- a/plugin/src/main/webapp/icons/coverage.svg +++ /dev/null @@ -1,46 +0,0 @@ - - diff --git a/plugin/src/test/java/io/jenkins/plugins/coverage/BlockSlaveToMasterFileCallable.java b/plugin/src/test/java/io/jenkins/plugins/coverage/BlockSlaveToMasterFileCallable.java deleted file mode 100644 index 190f1ec42..000000000 --- a/plugin/src/test/java/io/jenkins/plugins/coverage/BlockSlaveToMasterFileCallable.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * The MIT License - * - * Copyright 2021 CloudBees, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package io.jenkins.plugins.coverage; - -import edu.umd.cs.findbugs.annotations.Nullable; -import hudson.Extension; -import hudson.remoting.ChannelBuilder; -import java.io.File; -import jenkins.ReflectiveFilePathFilter; -import jenkins.SlaveToMasterFileCallable; -import jenkins.security.ChannelConfigurator; - -/** - * Prevents all {@link SlaveToMasterFileCallable}s from running during tests, to make sure we do not rely on them. - */ -public class BlockSlaveToMasterFileCallable extends ReflectiveFilePathFilter { - - @Override protected boolean op(String name, File path) throws SecurityException { - throw new SecurityException("refusing to " + name + " on " + path); - } - - @Extension public static class ChannelConfiguratorImpl extends ChannelConfigurator { - - @Override public void onChannelBuilding(ChannelBuilder builder, @Nullable Object context) { - new BlockSlaveToMasterFileCallable().installTo(builder, 1000); // higher priority than, say, AdminFilePathFilter or even DefaultFilePathFilter - } - - } - -}