Skip to content

Commit 487364c

Browse files
authored
Merge branch 'master' into create-ssh-dir-with-better-perms
2 parents a09e86f + 22ae6fa commit 487364c

File tree

63 files changed

+482
-383
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+482
-383
lines changed

.github/pull_request_template.md

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Jenkins Security Scan
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types: [ opened, synchronize, reopened ]
9+
workflow_dispatch:
10+
11+
permissions:
12+
security-events: write
13+
contents: read
14+
actions: read
15+
16+
jobs:
17+
security-scan:
18+
uses: jenkins-infra/jenkins-security-scan/.github/workflows/jenkins-security-scan.yaml@v2
19+
with:
20+
java-cache: 'maven' # Optionally enable use of a build dependency cache. Specify 'maven' or 'gradle' as appropriate.
21+
# java-version: 21 # Optionally specify what version of Java to set up for the build, or remove to use a recent default.

pom.xml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.jenkins-ci.plugins</groupId>
77
<artifactId>plugin</artifactId>
8-
<version>4.83</version>
8+
<version>5.2</version>
99
<relativePath />
1010
</parent>
1111

@@ -36,11 +36,6 @@
3636
<email>rsandell@cloudbees.com</email>
3737
<url>http://rsandell.com</url>
3838
</developer>
39-
<developer>
40-
<id>mramonleon</id>
41-
<name>M Ramon Leon</name>
42-
<email>rleon@cloudbees.com</email>
43-
</developer>
4439
<developer>
4540
<id>olamy</id>
4641
<name>Olivier Lamy</name>
@@ -58,14 +53,17 @@
5853
</scm>
5954

6055
<properties>
61-
<revision>5.0.1</revision>
56+
<revision>6.1.1</revision>
6257
<changelist>-SNAPSHOT</changelist>
6358
<!-- Character set tests fail unless file.encoding is set -->
6459
<argLine>-Dfile.encoding=${project.build.sourceEncoding}</argLine>
6560
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
6661
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
67-
<jenkins.version>2.440.3</jenkins.version>
68-
<jgit.version>6.10.0.202406032230-r</jgit.version>
62+
<jenkins.baseline>2.479</jenkins.baseline>
63+
<!-- TODO Replace with the standard jenkins.baseline references after LTS requires Java 17 -->
64+
<!-- <jenkins.version>${jenkins.baseline}.1</jenkins.version> -->
65+
<jenkins.version>${jenkins.baseline}</jenkins.version>
66+
<jgit.version>7.0.0.202409031743-r</jgit.version>
6967
<spotbugs.effort>Max</spotbugs.effort>
7068
<spotbugs.threshold>Low</spotbugs.threshold>
7169
<spotless.check.skip>false</spotless.check.skip>
@@ -75,8 +73,8 @@
7573
<dependencies>
7674
<dependency>
7775
<groupId>io.jenkins.tools.bom</groupId>
78-
<artifactId>bom-2.440.x</artifactId>
79-
<version>3135.v6d6c1f6b_3572</version>
76+
<artifactId>bom-${jenkins.baseline}.x</artifactId>
77+
<version>3559.vb_5b_81183b_d23</version>
8078
<type>pom</type>
8179
<scope>import</scope>
8280
</dependency>
@@ -216,7 +214,7 @@
216214
<dependency>
217215
<groupId>io.github.sparsick.testcontainers.gitserver</groupId>
218216
<artifactId>testcontainers-gitserver</artifactId>
219-
<version>0.8.0</version>
217+
<version>0.10.0</version>
220218
<scope>test</scope>
221219
<exclusions>
222220
<exclusion>
@@ -238,13 +236,13 @@
238236
<dependency>
239237
<groupId>nl.jqno.equalsverifier</groupId>
240238
<artifactId>equalsverifier</artifactId>
241-
<version>3.16.1</version>
239+
<version>3.17.1</version>
242240
<scope>test</scope>
243241
</dependency>
244242
<dependency>
245243
<groupId>org.awaitility</groupId>
246244
<artifactId>awaitility</artifactId>
247-
<version>4.2.1</version>
245+
<version>4.2.2</version>
248246
<scope>test</scope>
249247
</dependency>
250248
<dependency>
@@ -274,7 +272,7 @@
274272
<dependency>
275273
<groupId>org.testcontainers</groupId>
276274
<artifactId>testcontainers</artifactId>
277-
<version>1.19.8</version>
275+
<version>1.20.3</version>
278276
<scope>test</scope>
279277
</dependency>
280278
</dependencies>

src/main/java/hudson/plugins/git/Branch.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package hudson.plugins.git;
22

3+
import java.io.Serial;
34
import java.util.Objects;
45
import org.eclipse.jgit.lib.ObjectId;
56
import org.eclipse.jgit.lib.Ref;
@@ -8,6 +9,7 @@
89
* Represents a git branch.
910
*/
1011
public class Branch extends GitObject {
12+
@Serial
1113
private static final long serialVersionUID = 1L;
1214

1315
/**
@@ -39,7 +41,7 @@ private static String strip(String name) {
3941
*/
4042
@Override
4143
public String toString() {
42-
return String.format("Branch %s(%s)", name, getSHA1String());
44+
return "Branch %s(%s)".formatted(name, getSHA1String());
4345
}
4446

4547
/**

src/main/java/hudson/plugins/git/GitAPI.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
*/
2929
@Deprecated
3030
public class GitAPI extends CliGitAPIImpl {
31+
@Serial
3132
private static final long serialVersionUID = 1L;
33+
3234
private final GitClient jgit;
3335

3436
/**

src/main/java/hudson/plugins/git/GitException.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
package hudson.plugins.git;
22

3+
import java.io.Serial;
4+
35
/**
46
* Records exception information related to git operations. This exception is
57
* used to encapsulate command line git errors, JGit errors, and other errors
68
* related to git operations.
79
*/
810
public class GitException extends RuntimeException {
11+
@Serial
912
private static final long serialVersionUID = 1L;
1013

1114
/**

src/main/java/hudson/plugins/git/GitLockFailedException.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
package hudson.plugins.git;
22

3+
import java.io.Serial;
4+
35
/**
46
* Exception which reports failure to lock a git repository. Lock failures are
57
* a special case and may indicate that a retry attempt might succeed.
68
*/
79
public class GitLockFailedException extends GitException {
10+
@Serial
811
private static final long serialVersionUID = 1L;
912

1013
/**

src/main/java/hudson/plugins/git/GitObject.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package hudson.plugins.git;
22

33
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
4+
import java.io.Serial;
45
import java.io.Serializable;
56
import java.util.Objects;
67
import org.eclipse.jgit.lib.ObjectId;
@@ -14,6 +15,7 @@
1415
@ExportedBean(defaultVisibility = 999)
1516
public class GitObject implements Serializable {
1617

18+
@Serial
1719
private static final long serialVersionUID = 1L;
1820

1921
final ObjectId sha1;

src/main/java/hudson/plugins/git/GitTool.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import hudson.util.FormValidation;
1818
import java.io.File;
1919
import java.io.IOException;
20+
import java.io.Serial;
2021
import java.util.ArrayList;
2122
import java.util.Collections;
2223
import java.util.List;
@@ -27,7 +28,7 @@
2728
import org.jenkinsci.Symbol;
2829
import org.kohsuke.stapler.DataBoundConstructor;
2930
import org.kohsuke.stapler.QueryParameter;
30-
import org.kohsuke.stapler.StaplerRequest;
31+
import org.kohsuke.stapler.StaplerRequest2;
3132
import org.kohsuke.stapler.interceptor.RequirePOST;
3233

3334
/**
@@ -53,6 +54,7 @@ public GitTool(String name, String home, List<? extends ToolProperty<?>> propert
5354
/** Constant <code>DEFAULT="Default"</code> */
5455
public static final transient String DEFAULT = "Default";
5556

57+
@Serial
5658
private static final long serialVersionUID = 1;
5759

5860
/**
@@ -153,7 +155,7 @@ public String getDisplayName() {
153155
}
154156

155157
@Override
156-
public boolean configure(StaplerRequest req, JSONObject json) {
158+
public boolean configure(StaplerRequest2 req, JSONObject json) {
157159
setInstallations(req.bindJSONToList(clazz, json.get("tool")).toArray(new GitTool[0]));
158160
save();
159161
return true;

src/main/java/hudson/plugins/git/IGitAPI.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public interface IGitAPI extends GitClient {
138138
* @param remoteRepository remote configuration from which refs will be retrieved
139139
* @throws java.lang.InterruptedException if interrupted.
140140
*/
141-
void fetch(RemoteConfig remoteRepository) throws InterruptedException;
141+
void fetch(RemoteConfig remoteRepository) throws GitException, InterruptedException;
142142

143143
/**
144144
* Retrieve commits from default remote.
@@ -281,7 +281,7 @@ public interface IGitAPI extends GitClient {
281281
* @return a {@link org.eclipse.jgit.lib.ObjectId} object.
282282
* @throws java.lang.InterruptedException if interrupted.
283283
*/
284-
ObjectId mergeBase(ObjectId sha1, ObjectId sha2) throws InterruptedException;
284+
ObjectId mergeBase(ObjectId sha1, ObjectId sha2) throws GitException, InterruptedException;
285285

286286
/**
287287
* showRevision.
@@ -304,5 +304,5 @@ public interface IGitAPI extends GitClient {
304304
*/
305305
@Restricted(NoExternalUse.class)
306306
@Deprecated
307-
String getAllLogEntries(String branch) throws InterruptedException;
307+
String getAllLogEntries(String branch) throws GitException, InterruptedException;
308308
}

0 commit comments

Comments
 (0)