Skip to content

Commit 30a8df6

Browse files
authored
Merge pull request #482 from jenkinsci/dependabot/github_actions/actions/upload-artifact-5
Bump actions/upload-artifact from 4 to 5
2 parents 13f2365 + 750f060 commit 30a8df6

8 files changed

Lines changed: 52 additions & 32 deletions

File tree

.github/workflows/quality-monitor-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
fi
5050
mv -fv maven.log target/maven.log
5151
- name: Upload Quality Reports
52-
uses: actions/upload-artifact@v4
52+
uses: actions/upload-artifact@v5
5353
with:
5454
name: quality-reports
5555
path: |

pom.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@
8282
</exclusion>
8383
</exclusions>
8484
</dependency>
85+
<dependency>
86+
<groupId>com.github.spotbugs</groupId>
87+
<artifactId>spotbugs-annotations</artifactId>
88+
<scope>provided</scope>
89+
</dependency>
8590
<dependency>
8691
<groupId>com.google.errorprone</groupId>
8792
<artifactId>error_prone_annotations</artifactId>
@@ -302,6 +307,19 @@
302307
<classQualifiedName>io.jenkins.plugins.datatables.TableConfiguration</classQualifiedName>
303308
<justification>This enum is safe to be exposed.</justification>
304309
</item>
310+
<item>
311+
<ignore>true</ignore>
312+
<code>java.missing.oldSuperType</code>
313+
<classQualifiedName>io.jenkins.plugins.util.QualityGate</classQualifiedName>
314+
<justification>Superclass is deprecated</justification>
315+
</item>
316+
<item>
317+
<ignore>true</ignore>
318+
<regex>true</regex>
319+
<code>java.field.serialVersionUIDChanged</code>
320+
<classQualifiedName>.*</classQualifiedName>
321+
<justification>Use ArrayList rather than List</justification>
322+
</item>
305323
</differences>
306324
</revapi.differences>
307325
<revapi.filter>

src/main/java/io/jenkins/plugins/util/AbstractXmlStream.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
package io.jenkins.plugins.util;
22

3-
import java.io.IOException;
4-
import java.nio.file.Path;
5-
import java.util.logging.Level;
6-
import java.util.logging.Logger;
7-
83
import com.thoughtworks.xstream.XStream;
94
import com.thoughtworks.xstream.converters.Converter;
105
import com.thoughtworks.xstream.converters.MarshallingContext;
@@ -16,6 +11,11 @@
1611
import edu.hm.hafner.util.TreeStringBuilder;
1712
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
1813

14+
import java.io.IOException;
15+
import java.nio.file.Path;
16+
import java.util.logging.Level;
17+
import java.util.logging.Logger;
18+
1919
import hudson.XmlFile;
2020
import hudson.util.XStream2;
2121

@@ -139,6 +139,7 @@ public Object unmarshal(final HierarchicalStreamReader reader, final Unmarshalli
139139
}
140140

141141
@Override
142+
@SuppressWarnings("rawtypes")
142143
public boolean canConvert(final Class type) {
143144
return type == TreeString.class;
144145
}

src/main/java/io/jenkins/plugins/util/AgentFileVisitor.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
package io.jenkins.plugins.util;
22

3+
import org.apache.commons.lang3.StringUtils;
4+
import org.apache.tools.ant.BuildException;
5+
import org.apache.tools.ant.Project;
6+
import org.apache.tools.ant.types.FileSet;
7+
import org.apache.tools.ant.types.selectors.TypeSelector;
8+
import org.apache.tools.ant.types.selectors.TypeSelector.FileType;
9+
10+
import edu.hm.hafner.util.FilteredLog;
11+
import edu.hm.hafner.util.VisibleForTesting;
12+
313
import java.io.File;
414
import java.io.IOException;
515
import java.io.Serial;
@@ -12,16 +22,6 @@
1222
import java.util.List;
1323
import java.util.Optional;
1424

15-
import org.apache.commons.lang3.StringUtils;
16-
import org.apache.tools.ant.BuildException;
17-
import org.apache.tools.ant.Project;
18-
import org.apache.tools.ant.types.FileSet;
19-
import org.apache.tools.ant.types.selectors.TypeSelector;
20-
import org.apache.tools.ant.types.selectors.TypeSelector.FileType;
21-
22-
import edu.hm.hafner.util.FilteredLog;
23-
import edu.hm.hafner.util.VisibleForTesting;
24-
2525
import hudson.remoting.VirtualChannel;
2626
import jenkins.MasterToSlaveFileCallable;
2727

@@ -257,10 +257,10 @@ public String[] find(final File workspace) {
257257
*/
258258
public static class FileVisitorResult<T extends Serializable> implements Serializable {
259259
@Serial
260-
private static final long serialVersionUID = 2122230867938547733L;
261-
260+
private static final long serialVersionUID = 5094277468158899325L;
262261
private final FilteredLog log;
263-
private final List<T> results;
262+
@SuppressWarnings("PMD.LooseCoupling")
263+
private final ArrayList<T> results;
264264

265265
FileVisitorResult(final FilteredLog log) {
266266
this(log, Collections.emptyList());

src/main/java/io/jenkins/plugins/util/BuildAction.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package io.jenkins.plugins.util;
22

3+
import edu.hm.hafner.util.VisibleForTesting;
4+
import edu.umd.cs.findbugs.annotations.CheckForNull;
5+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
6+
37
import java.io.Serial;
48
import java.io.Serializable;
59
import java.lang.ref.WeakReference;
@@ -9,10 +13,6 @@
913
import java.util.Set;
1014
import java.util.concurrent.locks.ReentrantLock;
1115

12-
import edu.hm.hafner.util.VisibleForTesting;
13-
import edu.umd.cs.findbugs.annotations.CheckForNull;
14-
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
15-
1616
import hudson.model.Action;
1717
import hudson.model.Run;
1818
import jenkins.model.RunAction2;
@@ -62,7 +62,7 @@ protected BuildAction(final Run<?, ?> owner, final T result) {
6262
* determines whether the result should be persisted in the build folder
6363
*/
6464
@SuppressFBWarnings(value = "MC", justification = "getResultXmlPath() is a factory method and overridable by design")
65-
@SuppressWarnings("PMD.ConstructorCallsOverridableMethod")
65+
@SuppressWarnings({"PMD.ConstructorCallsOverridableMethod", "this-escape"})
6666
@VisibleForTesting
6767
public BuildAction(final Run<?, ?> owner, final T result, final boolean canSerialize) {
6868
this.owner = owner;

src/main/java/io/jenkins/plugins/util/QualityGate.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
package io.jenkins.plugins.util;
22

3+
import edu.hm.hafner.util.VisibleForTesting;
4+
35
import java.io.Serial;
46
import java.io.Serializable;
57

6-
import edu.hm.hafner.util.VisibleForTesting;
7-
88
import org.kohsuke.stapler.AncestorInPath;
99
import org.kohsuke.stapler.DataBoundSetter;
1010
import org.kohsuke.stapler.verb.POST;
1111
import hudson.Extension;
12-
import hudson.model.AbstractDescribableImpl;
1312
import hudson.model.BuildableItem;
13+
import hudson.model.Describable;
1414
import hudson.model.Descriptor;
1515
import hudson.model.FreeStyleProject;
1616
import hudson.util.ListBoxModel;
@@ -27,7 +27,7 @@
2727
*
2828
* @author Johannes Walter
2929
*/
30-
public abstract class QualityGate extends AbstractDescribableImpl<QualityGate> implements Serializable {
30+
public abstract class QualityGate implements Describable<QualityGate>, Serializable {
3131
@Serial
3232
private static final long serialVersionUID = -397278599489426668L;
3333

src/main/java/io/jenkins/plugins/util/QualityGateResult.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@
1919
*/
2020
public class QualityGateResult implements Serializable {
2121
@Serial
22-
private static final long serialVersionUID = -4306601972076922976L;
22+
private static final long serialVersionUID = 1626549055698872334L;
2323

2424
private QualityGateStatus overallStatus;
25-
private final List<QualityGateResultItem> items = new ArrayList<>();
25+
@SuppressWarnings("PMD.LooseCoupling")
26+
private final ArrayList<QualityGateResultItem> items = new ArrayList<>();
2627

2728
/**
2829
* Creates a new instance of {@link QualityGateResult} that has its overall status set to

src/test/java/io/jenkins/plugins/util/FormValidationAssert.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.jenkins.plugins.util;
22

3-
import org.apache.commons.lang3.StringUtils;
3+
import org.apache.commons.lang3.Strings;
44
import org.apache.commons.text.StringEscapeUtils;
55
import org.assertj.core.api.AbstractAssert;
66

@@ -111,7 +111,7 @@ public FormValidationAssert hasMessageContaining(final String expectedMessagePar
111111
isNotNull();
112112

113113
String actualMessage = StringEscapeUtils.unescapeHtml4(actual.getMessage());
114-
if (!StringUtils.contains(actualMessage, expectedMessagePart)) {
114+
if (!Strings.CS.contains(actualMessage, expectedMessagePart)) {
115115
failWithMessage("%nExpecting %s of:%n <%s>%nto contain:%n <%s>%nbut was:%n <%s>.", "message",
116116
StringEscapeUtils.unescapeHtml4(actual.toString()), expectedMessagePart, actualMessage);
117117
}

0 commit comments

Comments
 (0)