From c14430c1bb8583562f27fb7d73b20cb80bff2c3f Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Tue, 6 Aug 2024 22:23:47 -0600 Subject: [PATCH 01/13] Test JGit 7.0.0-m2 pre-release with Java 17 build JGit 7.0.0 requires Java 17. Jenkins 2.463 requires Java 17. Use the plugin bill of materials from 2.462.x because it is the closest we have to 2.463. The plugin is expected to work with any release 2.463 or later. --- pom.xml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 9ea2b48260..b3f7db12af 100644 --- a/pom.xml +++ b/pom.xml @@ -58,15 +58,19 @@ - 5.0.1 + 6.0.0 -SNAPSHOT -Dfile.encoding=${project.build.sourceEncoding} jenkinsci/${project.artifactId}-plugin - 2.440 - ${jenkins.baseline}.3 - 6.10.0.202406032230-r + 2.462 + + + 2.463 + 7.0.0.202407311305-m2 + + 17 Max Low false From 7f33b1678054e8f34a154320cb8f240f4a405e19 Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Tue, 6 Aug 2024 19:38:12 -0600 Subject: [PATCH 02/13] Test JGit 7.0.0 with Jakarta EE 9 Jenkins core --- pom.xml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b3f7db12af..6008fcdf54 100644 --- a/pom.xml +++ b/pom.xml @@ -67,9 +67,10 @@ 2.462 - 2.463 + 2.471-rc35177.b_db_d5fa_b_389a_ 7.0.0.202407311305-m2 + 2254.vcff7a_d4969e5 17 Max Low @@ -85,6 +86,12 @@ pom import + + + jakarta.servlet + jakarta.servlet-api + 5.0.0 + From 42b753349d6d10e21d900b26935eb047d4c90e50 Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Fri, 23 Aug 2024 15:24:33 -0600 Subject: [PATCH 03/13] Use JGit 7.0.0.202408202050-m3 pre-release --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 39c0915ace..657aa7effa 100644 --- a/pom.xml +++ b/pom.xml @@ -68,7 +68,7 @@ 2.463 - 7.0.0.202407311305-m2 + 7.0.0.202408202050-m3 17 Max From 3398faa1fa5ff8f97cf86725354b6bddc631ee87 Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Thu, 5 Sep 2024 17:02:12 -0600 Subject: [PATCH 04/13] Use JGit 7.0.0.202409031743-r --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1f175a7457..2d22463ef3 100644 --- a/pom.xml +++ b/pom.xml @@ -68,7 +68,7 @@ 2.463 - 7.0.0.202408202050-m3 + 7.0.0.202409031743-r 17 Max From 8f47f3cd21a5ee7e7176836f18a6962ac713e719 Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Thu, 5 Sep 2024 17:24:49 -0600 Subject: [PATCH 05/13] Adapt to removed API's in JGit 7.0.0 --- .../plugins/gitclient/JGitAPIImpl.java | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java b/src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java index e6deb83e49..99d1d49c3d 100644 --- a/src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java +++ b/src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java @@ -476,7 +476,7 @@ private void doCheckoutWithResetAndRetry(String ref) throws GitException { if (repo.resolve(ref) != null) { // ref is either an existing reference or a shortcut to a tag or branch (without refs/heads/) - git(repo).checkout().setName(ref).setForce(true).call(); + git(repo).checkout().setName(ref).setForceRefUpdate(true).call(); return; } @@ -550,7 +550,7 @@ private void doCheckout(String ref, String branch) throws GitException { .checkout() .setName(branch) .setCreateBranch(true) - .setForce(true) + .setForceRefUpdate(true) .setStartPoint(ref) .call(); } catch (GitAPIException e) { @@ -2063,7 +2063,11 @@ public boolean isCommitInRepo(ObjectId commit) throws GitException { } final boolean found; try (Repository repo = getRepository()) { - found = repo.hasObject(commit); + try { + found = repo.getObjectDatabase().has(commit); + } catch (IOException ioe) { + throw new GitException(ioe); + } } return found; } @@ -2903,7 +2907,7 @@ public String describe(String tip) throws GitException, InterruptedException { Map tags = new HashMap<>(); for (Ref r : repo.getTags().values()) { - ObjectId key = repo.peel(r).getPeeledObjectId(); + ObjectId key = repo.getRefDatabase().peel(r).getPeeledObjectId(); if (key == null) { key = r.getObjectId(); } @@ -3157,9 +3161,13 @@ public Set getTags() throws GitException { String tagName = entry.getKey(); Ref tagRef = entry.getValue(); if (!tagRef.isPeeled()) { - Ref peeledRef = repo.peel(tagRef); - if (peeledRef.getPeeledObjectId() != null) { - tagRef = peeledRef; // Use peeled ref instead of annotated ref + try { + Ref peeledRef = repo.getRefDatabase().peel(tagRef); + if (peeledRef.getPeeledObjectId() != null) { + tagRef = peeledRef; // Use peeled ref instead of annotated ref + } + } catch (IOException ioe) { + throw new GitException(ioe); } } /* Packed lightweight (non-annotated) tags can wind up peeled with no peeled obj ID */ From 15c3bdcebf8a71bac852d8fd0e99eb912358ac8d Mon Sep 17 00:00:00 2001 From: git-client-user Date: Fri, 6 Sep 2024 06:47:24 -0600 Subject: [PATCH 06/13] Use test harness 2265.x --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 092190c27c..b3a950f0f3 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ 2.475 7.0.0.202409031743-r - 2254.vcff7a_d4969e5 + 2265.v3da_49c8134d6 17 Max Low From 480ce4b97f089d1c30871fb5f73a432baa0bc982 Mon Sep 17 00:00:00 2001 From: git-client-user Date: Fri, 6 Sep 2024 07:05:49 -0600 Subject: [PATCH 07/13] Next Jenkins baseline will be a .1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2d22463ef3..d4d096a1ce 100644 --- a/pom.xml +++ b/pom.xml @@ -65,8 +65,8 @@ jenkinsci/${project.artifactId}-plugin 2.462 - + 2.463 7.0.0.202409031743-r From 1189a302a5a7c04595491d09800e3c1466ee4b6f Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Tue, 6 Aug 2024 22:23:47 -0600 Subject: [PATCH 08/13] Use JGit 7.0.0 with Java 17 JGit 7.0.0 requires Java 17. Jenkins 2.463 requires Java 17. Use the plugin bill of materials from 2.462.x because it is the closest we have to 2.463. The plugin is expected to work with any release 2.463 or later. Adapt to removed API's in JGit 7.0.0 by replacing calls to removed API's with the recommended equivalents. Tested in my development environment and no issues detected. Tests run from a container based Jenkins controller with Windows, Linux, and FreeBSD agents. Tests ran on multiple weekly releases of Jenkins since 2.463. The Linux agents include: * Alpine * Debian Linux 11, 12, testing, and unstable * openSUSE * Red Hat Enterprise Linux 8 * Rocky Linux 9 * Ubuntu 20.04, 22.04, and 24.04 --- pom.xml | 12 ++++++---- .../plugins/gitclient/JGitAPIImpl.java | 22 +++++++++++++------ 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index 736dce20b6..d4d096a1ce 100644 --- a/pom.xml +++ b/pom.xml @@ -58,15 +58,19 @@ - 5.0.1 + 6.0.0 -SNAPSHOT -Dfile.encoding=${project.build.sourceEncoding} jenkinsci/${project.artifactId}-plugin - 2.440 - ${jenkins.baseline}.3 - 6.10.0.202406032230-r + 2.462 + + + 2.463 + 7.0.0.202409031743-r + + 17 Max Low false diff --git a/src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java b/src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java index e6deb83e49..99d1d49c3d 100644 --- a/src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java +++ b/src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java @@ -476,7 +476,7 @@ private void doCheckoutWithResetAndRetry(String ref) throws GitException { if (repo.resolve(ref) != null) { // ref is either an existing reference or a shortcut to a tag or branch (without refs/heads/) - git(repo).checkout().setName(ref).setForce(true).call(); + git(repo).checkout().setName(ref).setForceRefUpdate(true).call(); return; } @@ -550,7 +550,7 @@ private void doCheckout(String ref, String branch) throws GitException { .checkout() .setName(branch) .setCreateBranch(true) - .setForce(true) + .setForceRefUpdate(true) .setStartPoint(ref) .call(); } catch (GitAPIException e) { @@ -2063,7 +2063,11 @@ public boolean isCommitInRepo(ObjectId commit) throws GitException { } final boolean found; try (Repository repo = getRepository()) { - found = repo.hasObject(commit); + try { + found = repo.getObjectDatabase().has(commit); + } catch (IOException ioe) { + throw new GitException(ioe); + } } return found; } @@ -2903,7 +2907,7 @@ public String describe(String tip) throws GitException, InterruptedException { Map tags = new HashMap<>(); for (Ref r : repo.getTags().values()) { - ObjectId key = repo.peel(r).getPeeledObjectId(); + ObjectId key = repo.getRefDatabase().peel(r).getPeeledObjectId(); if (key == null) { key = r.getObjectId(); } @@ -3157,9 +3161,13 @@ public Set getTags() throws GitException { String tagName = entry.getKey(); Ref tagRef = entry.getValue(); if (!tagRef.isPeeled()) { - Ref peeledRef = repo.peel(tagRef); - if (peeledRef.getPeeledObjectId() != null) { - tagRef = peeledRef; // Use peeled ref instead of annotated ref + try { + Ref peeledRef = repo.getRefDatabase().peel(tagRef); + if (peeledRef.getPeeledObjectId() != null) { + tagRef = peeledRef; // Use peeled ref instead of annotated ref + } + } catch (IOException ioe) { + throw new GitException(ioe); } } /* Packed lightweight (non-annotated) tags can wind up peeled with no peeled obj ID */ From dfd8fe75a29bbecc8ebb4509f9fe1ea4134b8e02 Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Thu, 12 Sep 2024 15:16:08 -0600 Subject: [PATCH 09/13] Use 6.1.0 as version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ac4bcdba8b..b32d043b0f 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,7 @@ - 6.0.0 + 6.1.0 -SNAPSHOT -Dfile.encoding=${project.build.sourceEncoding} From 086160aef4ac7956c33a81a4c1370cc395683efa Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Thu, 12 Sep 2024 18:21:24 -0600 Subject: [PATCH 10/13] Use Java 17 features in source code https://docs.openrewrite.org/running-recipes/popular-recipe-guides/migrate-to-java-17 provided the transformations and they all pass automated tests. Several nice readability improvements are provided by Java 17. --- src/main/java/hudson/plugins/git/Branch.java | 2 +- .../java/hudson/plugins/git/IndexEntry.java | 2 +- .../plugins/gitclient/CliGitAPIImpl.java | 34 ++++++------ .../gitclient/GitToolConfigurator.java | 3 +- .../plugins/gitclient/JGitAPIImpl.java | 25 ++++----- .../plugins/gitclient/RemoteGitImpl.java | 8 +-- .../jgit/CredentialsProviderImpl.java | 13 ++--- .../PreemptiveAuthHttpClientConnection.java | 6 +- .../jgit/SmartCredentialsProvider.java | 21 +++---- .../verifier/KnownHostsFileVerifier.java | 15 +++-- .../verifier/ManuallyProvidedKeyVerifier.java | 4 +- .../SshHostKeyVerificationStrategy.java | 4 +- .../java/jmh/benchmark/BenchmarkRunner.java | 4 +- .../jmh/benchmark/FolderForBenchmark.java | 7 ++- .../gitclient/FilePermissionsTest.java | 6 +- .../plugins/gitclient/GitAPITestUpdate.java | 47 ++++++++-------- .../gitclient/GitAPITestUpdateCliGit.java | 4 +- .../gitclient/GitClientMaintenanceTest.java | 5 +- .../gitclient/GitClientSecurityTest.java | 4 +- .../plugins/gitclient/GitClientTest.java | 55 ++++++++++--------- .../plugins/gitclient/NetrcTest.java | 8 +-- .../plugins/gitclient/jgit/AuthzTest.java | 12 ++-- .../AcceptFirstConnectionVerifierTest.java | 53 ++++++++++++------ .../verifier/KnownHostsFileVerifierTest.java | 9 ++- .../verifier/KnownHostsTestUtil.java | 11 ++-- .../verifier/NoHostKeyVerifierTest.java | 4 +- 26 files changed, 193 insertions(+), 173 deletions(-) diff --git a/src/main/java/hudson/plugins/git/Branch.java b/src/main/java/hudson/plugins/git/Branch.java index bcab130a87..bf8f5a3647 100644 --- a/src/main/java/hudson/plugins/git/Branch.java +++ b/src/main/java/hudson/plugins/git/Branch.java @@ -39,7 +39,7 @@ private static String strip(String name) { */ @Override public String toString() { - return String.format("Branch %s(%s)", name, getSHA1String()); + return "Branch %s(%s)".formatted(name, getSHA1String()); } /** diff --git a/src/main/java/hudson/plugins/git/IndexEntry.java b/src/main/java/hudson/plugins/git/IndexEntry.java index 5937cda2ce..82789cdc76 100644 --- a/src/main/java/hudson/plugins/git/IndexEntry.java +++ b/src/main/java/hudson/plugins/git/IndexEntry.java @@ -91,7 +91,7 @@ public void setFile(String file) { */ @Override public String toString() { - return String.format("IndexEntry[mode=%s,type=%s,file=%s,object=%s]", mode, type, file, object); + return "IndexEntry[mode=%s,type=%s,file=%s,object=%s]".formatted(mode, type, file, object); } /** diff --git a/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java b/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java index 20bb931db1..9b32e16dc1 100644 --- a/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java +++ b/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java @@ -30,7 +30,6 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.Paths; import java.nio.file.attribute.AclEntry; import java.nio.file.attribute.AclEntryPermission; import java.nio.file.attribute.AclEntryType; @@ -1976,7 +1975,7 @@ Path createTempFile(String prefix, String suffix) throws IOException { return createTempFileInSystemDir(prefix, suffix); } } - Path tmpPath = Paths.get(workspaceTmp.getAbsolutePath()); + Path tmpPath = Path.of(workspaceTmp.getAbsolutePath()); if (workspaceTmp.getAbsolutePath().contains("%")) { // Avoid ssh token expansion on all platforms return createTempFileInSystemDir(prefix, suffix); @@ -2098,8 +2097,7 @@ private String launchCommandWithCredentials( } } try { - if (credentials instanceof SSHUserPrivateKey) { - SSHUserPrivateKey sshUser = (SSHUserPrivateKey) credentials; + if (credentials instanceof SSHUserPrivateKey sshUser) { listener.getLogger().println("using GIT_SSH to set credentials " + sshUser.getDescription()); key = createSshKeyFile(sshUser); @@ -2130,8 +2128,7 @@ private String launchCommandWithCredentials( env.put("DISPLAY", ":"); } - } else if (credentials instanceof StandardUsernamePasswordCredentials) { - StandardUsernamePasswordCredentials userPass = (StandardUsernamePasswordCredentials) credentials; + } else if (credentials instanceof StandardUsernamePasswordCredentials userPass) { listener.getLogger().println("using GIT_ASKPASS to set credentials " + userPass.getDescription()); usernameFile = createUsernameFile(userPass); @@ -2207,7 +2204,7 @@ private Boolean fixSELinuxLabel(Path key, String label) { // "untrusted" key files. // Check that tools exist and then if SELinux subsystem is activated // Otherwise calling the tools just pollutes build log with errors - if (Files.isExecutable(Paths.get("/usr/bin/chcon"))) { + if (Files.isExecutable(Path.of("/usr/bin/chcon"))) { // SELinux may actually forbid us to read system paths, so // there are a couple of ways to try checking if it is enabled // (whether this run needs to worry about security labels) and @@ -2222,10 +2219,10 @@ private Boolean fixSELinuxLabel(Path key, String label) { try { // A process should always have rights to inspect itself, but // on some systems even this read returns "Invalid argument" - if (Files.isRegularFile(Paths.get("/proc/self/attr/current"))) { + if (Files.isRegularFile(Path.of("/proc/self/attr/current"))) { String s; try (BufferedReader br = - Files.newBufferedReader(Paths.get("/proc/self/attr/current"), StandardCharsets.UTF_8)) { + Files.newBufferedReader(Path.of("/proc/self/attr/current"), StandardCharsets.UTF_8)) { s = br.readLine(); } if ("unconfined".equals(s)) { @@ -2244,16 +2241,16 @@ private Boolean fixSELinuxLabel(Path key, String label) { } try { - if (!Files.isDirectory(Paths.get("/sys/fs/selinux"))) { + if (!Files.isDirectory(Path.of("/sys/fs/selinux"))) { // Assuming that lack of rights to read this is an // exception caught below, not a false return here? return true; } - if (Files.isRegularFile(Paths.get("/sys/fs/selinux/enforce"))) { + if (Files.isRegularFile(Path.of("/sys/fs/selinux/enforce"))) { String s; try (BufferedReader br = - Files.newBufferedReader(Paths.get("/sys/fs/selinux/enforce"), StandardCharsets.UTF_8)) { + Files.newBufferedReader(Path.of("/sys/fs/selinux/enforce"), StandardCharsets.UTF_8)) { s = br.readLine(); } if ("0".equals(s)) { @@ -2292,10 +2289,13 @@ private Boolean fixSELinuxLabel(Path key, String label) { if (!clue_sysfs && !clue_proc) { // && !clue_ls listener.getLogger() - .println("[INFO] SELinux is present on the host " - + "and we could not confirm that it does not apply actively: " - + "will try to relabel temporary files now; this may complain " - + "if context labeling not applicable after all"); + .println( + """ + [INFO] SELinux is present on the host \ + and we could not confirm that it does not apply actively: \ + will try to relabel temporary files now; this may complain \ + if context labeling not applicable after all\ + """); } ArgumentListBuilder args = new ArgumentListBuilder(); @@ -2721,7 +2721,7 @@ private Path createUnixGitSSH(Path key, String user, Path knownHosts) throws IOE private Path createNonBusyExecutable(Path p) throws IOException { p.toFile().setExecutable(true, true); - Path p_copy = Paths.get(p.toString() + "-copy"); + Path p_copy = Path.of(p.toString() + "-copy"); // JENKINS-48258 git client plugin occasionally fails with "text file busy" error // The following creates a copy of the generated file and deletes the original diff --git a/src/main/java/org/jenkinsci/plugins/gitclient/GitToolConfigurator.java b/src/main/java/org/jenkinsci/plugins/gitclient/GitToolConfigurator.java index 8f06e5da45..2d0ef18deb 100644 --- a/src/main/java/org/jenkinsci/plugins/gitclient/GitToolConfigurator.java +++ b/src/main/java/org/jenkinsci/plugins/gitclient/GitToolConfigurator.java @@ -101,8 +101,7 @@ private List> instantiateProperties( return toolProperties; } final Configurator configurator = context.lookupOrFail(ToolProperty.class); - if (props instanceof Sequence) { - Sequence s = (Sequence) props; + if (props instanceof Sequence s) { for (CNode cNode : s) { toolProperties.add(configurator.configure(cNode, context)); } diff --git a/src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java b/src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java index 99d1d49c3d..66a691ccfc 100644 --- a/src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java +++ b/src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java @@ -41,7 +41,6 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.Paths; import java.security.GeneralSecurityException; import java.util.ArrayList; import java.util.Arrays; @@ -236,7 +235,7 @@ public SshdSessionFactory buildSshdSessionFactory(@NonNull final HostKeyVerifier .setConfigStoreFactory((homeDir, configFile, localUserName) -> { String configFilePath = SystemProperties.getString(SSH_CONFIG_PATH); if (configFilePath != null) { - Path path = Paths.get(configFilePath); + Path path = Path.of(configFilePath); homeDir = path.toFile().getParentFile(); configFile = path.toFile(); } @@ -955,8 +954,8 @@ public Map getHeadRev(String url) throws GitException, Interru private TransportConfigCallback getTransportConfigCallback() { return transport -> { - if (transport instanceof SshTransport) { - ((SshTransport) transport).setSshSessionFactory(buildSshdSessionFactory(this.hostKeyVerifierFactory)); + if (transport instanceof SshTransport sshTransport) { + sshTransport.setSshSessionFactory(buildSshdSessionFactory(this.hostKeyVerifierFactory)); } if (transport instanceof HttpTransport) { ((TransportHttp) transport) @@ -966,8 +965,8 @@ private TransportConfigCallback getTransportConfigCallback() { } private void decorateTransport(Transport tn) { - if (tn instanceof SshTransport) { - ((SshTransport) tn).setSshSessionFactory(buildSshdSessionFactory(getHostKeyFactory())); + if (tn instanceof SshTransport transport) { + transport.setSshSessionFactory(buildSshdSessionFactory(getHostKeyFactory())); } if (tn instanceof HttpTransport) { ((TransportHttp) tn).setHttpConnectionFactory(new PreemptiveAuthHttpClientConnectionFactory(getProvider())); @@ -2239,7 +2238,7 @@ private String fixRefSpec(@NonNull String srcRefspec, Repository repository) thr case 0: // for the source ref. we use the repository to determine what should be pushed Ref ref = repository.findRef(specs[spec]); if (ref == null) { - throw new IOException(String.format("Ref %s not found.", specs[spec])); + throw new IOException("Ref %s not found.".formatted(specs[spec])); } specs[spec] = ref.getTarget().getName(); break; @@ -2947,11 +2946,11 @@ public boolean reaches(RevCommit c) { } public String describe(ObjectId tip) throws IOException { - return String.format( - "%s-%d-g%s", - tag.getName().substring(R_TAGS.length()), - depth, - or.abbreviate(tip).name()); + return "%s-%d-g%s" + .formatted( + tag.getName().substring(R_TAGS.length()), + depth, + or.abbreviate(tip).name()); } } List candidates = new ArrayList<>(); // all the candidates we find @@ -3049,7 +3048,7 @@ public List lsTree(String treeIsh, boolean recursive) throws GitExce while (tree.next()) { RevObject rev = w.parseAny(tree.getObjectId(0)); r.add(new IndexEntry( - String.format("%06o", tree.getRawMode(0)), + "%06o".formatted(tree.getRawMode(0)), typeString(rev.getType()), tree.getObjectId(0).name(), tree.getNameString())); diff --git a/src/main/java/org/jenkinsci/plugins/gitclient/RemoteGitImpl.java b/src/main/java/org/jenkinsci/plugins/gitclient/RemoteGitImpl.java index f2fb462b06..98f7833e4a 100644 --- a/src/main/java/org/jenkinsci/plugins/gitclient/RemoteGitImpl.java +++ b/src/main/java/org/jenkinsci/plugins/gitclient/RemoteGitImpl.java @@ -79,11 +79,11 @@ static class Invocation implements Serializable { parameterTypes[i] = paramTypes[i].getName(); } for (int i = 0; i < args.length; i++) { - if (args[i] instanceof OutputStream) { - args[i] = new RemoteOutputStream((OutputStream) args[i]); + if (args[i] instanceof OutputStream stream) { + args[i] = new RemoteOutputStream(stream); } - if (args[i] instanceof Writer) { - args[i] = new RemoteWriter((Writer) args[i]); + if (args[i] instanceof Writer writer) { + args[i] = new RemoteWriter(writer); } } } diff --git a/src/main/java/org/jenkinsci/plugins/gitclient/jgit/CredentialsProviderImpl.java b/src/main/java/org/jenkinsci/plugins/gitclient/jgit/CredentialsProviderImpl.java index 2200ce6a85..31f6001129 100644 --- a/src/main/java/org/jenkinsci/plugins/gitclient/jgit/CredentialsProviderImpl.java +++ b/src/main/java/org/jenkinsci/plugins/gitclient/jgit/CredentialsProviderImpl.java @@ -85,18 +85,17 @@ public boolean get(URIish uri, CredentialItem... items) throws UnsupportedCreden StandardUsernamePasswordCredentials _cred = (StandardUsernamePasswordCredentials) cred; for (CredentialItem i : items) { - if (i instanceof CredentialItem.Username) { - ((CredentialItem.Username) i).setValue(_cred.getUsername()); + if (i instanceof CredentialItem.Username username) { + username.setValue(_cred.getUsername()); continue; } - if (i instanceof CredentialItem.Password) { - ((CredentialItem.Password) i) - .setValue(_cred.getPassword().getPlainText().toCharArray()); + if (i instanceof CredentialItem.Password password) { + password.setValue(_cred.getPassword().getPlainText().toCharArray()); continue; } - if (i instanceof CredentialItem.StringType) { + if (i instanceof CredentialItem.StringType type) { if (i.getPromptText().equals("Password: ")) { - ((CredentialItem.StringType) i).setValue(_cred.getPassword().getPlainText()); + type.setValue(_cred.getPassword().getPlainText()); continue; } } diff --git a/src/main/java/org/jenkinsci/plugins/gitclient/jgit/PreemptiveAuthHttpClientConnection.java b/src/main/java/org/jenkinsci/plugins/gitclient/jgit/PreemptiveAuthHttpClientConnection.java index 3eb946e4c4..93817b5c24 100644 --- a/src/main/java/org/jenkinsci/plugins/gitclient/jgit/PreemptiveAuthHttpClientConnection.java +++ b/src/main/java/org/jenkinsci/plugins/gitclient/jgit/PreemptiveAuthHttpClientConnection.java @@ -261,8 +261,7 @@ static NTCredentials createNTCredentials(final String userName, final String pas private static void configureProxy(final HttpClientBuilder builder, final Proxy proxy) { if (proxy != null && !Proxy.NO_PROXY.equals(proxy)) { final SocketAddress socketAddress = proxy.address(); - if (socketAddress instanceof InetSocketAddress) { - final InetSocketAddress inetSocketAddress = (InetSocketAddress) socketAddress; + if (socketAddress instanceof InetSocketAddress inetSocketAddress) { final String proxyHost = inetSocketAddress.getHostName(); final int proxyPort = inetSocketAddress.getPort(); final HttpHost httpHost = new HttpHost(proxyHost, proxyPort); @@ -310,8 +309,7 @@ public String getResponseMessage() throws IOException { private void execute() throws IOException { if (resp == null) { if (entity != null) { - if (req instanceof HttpEntityEnclosingRequest) { - HttpEntityEnclosingRequest eReq = (HttpEntityEnclosingRequest) req; + if (req instanceof HttpEntityEnclosingRequest eReq) { eReq.setEntity(entity); } resp = getClient().execute(req); diff --git a/src/main/java/org/jenkinsci/plugins/gitclient/jgit/SmartCredentialsProvider.java b/src/main/java/org/jenkinsci/plugins/gitclient/jgit/SmartCredentialsProvider.java index 5ab64f80c8..06a24c4ab3 100644 --- a/src/main/java/org/jenkinsci/plugins/gitclient/jgit/SmartCredentialsProvider.java +++ b/src/main/java/org/jenkinsci/plugins/gitclient/jgit/SmartCredentialsProvider.java @@ -156,26 +156,23 @@ public boolean get(URIish uri, CredentialItem... credentialItems) throws Unsuppo return false; } for (CredentialItem i : credentialItems) { - if (i instanceof StandardUsernameCredentialsCredentialItem && c instanceof StandardUsernameCredentials) { - ((StandardUsernameCredentialsCredentialItem) i).setValue((StandardUsernameCredentials) c); + if (i instanceof StandardUsernameCredentialsCredentialItem item + && c instanceof StandardUsernameCredentials credentials) { + item.setValue(credentials); continue; } - if (i instanceof CredentialItem.Username && c instanceof UsernameCredentials) { - ((CredentialItem.Username) i).setValue(((UsernameCredentials) c).getUsername()); + if (i instanceof CredentialItem.Username username && c instanceof UsernameCredentials credentials) { + username.setValue(credentials.getUsername()); continue; } - if (i instanceof CredentialItem.Password && c instanceof PasswordCredentials) { - ((CredentialItem.Password) i) - .setValue(((PasswordCredentials) c) - .getPassword() - .getPlainText() - .toCharArray()); + if (i instanceof CredentialItem.Password password && c instanceof PasswordCredentials credentials) { + password.setValue(credentials.getPassword().getPlainText().toCharArray()); continue; } if (i instanceof CredentialItem.StringType) { - if (i.getPromptText().equals("Password: ") && c instanceof PasswordCredentials) { + if (i.getPromptText().equals("Password: ") && c instanceof PasswordCredentials credentials) { ((CredentialItem.StringType) i) - .setValue(((PasswordCredentials) c).getPassword().getPlainText()); + .setValue(credentials.getPassword().getPlainText()); continue; } } diff --git a/src/main/java/org/jenkinsci/plugins/gitclient/verifier/KnownHostsFileVerifier.java b/src/main/java/org/jenkinsci/plugins/gitclient/verifier/KnownHostsFileVerifier.java index 1eec293e99..aaa5b17fe5 100644 --- a/src/main/java/org/jenkinsci/plugins/gitclient/verifier/KnownHostsFileVerifier.java +++ b/src/main/java/org/jenkinsci/plugins/gitclient/verifier/KnownHostsFileVerifier.java @@ -65,12 +65,15 @@ public ServerKeyDatabase.Configuration getServerKeyDatabaseConfiguration() { private void logHint(TaskListener listener) { listener.getLogger() - .println(HyperlinkNote.encodeTo( - "https://plugins.jenkins.io/git-client/#plugin-content-ssh-host-key-verification", - "You're using 'Known hosts file' strategy to verify ssh host keys," - + " but your known_hosts file does not exist, please go to " - + "'Manage Jenkins' -> 'Security' -> 'Git Host Key Verification Configuration' " - + "and configure host key verification.")); + .println( + HyperlinkNote.encodeTo( + "https://plugins.jenkins.io/git-client/#plugin-content-ssh-host-key-verification", + """ + You're using 'Known hosts file' strategy to verify ssh host keys,\ + but your known_hosts file does not exist, please go to \ + 'Manage Jenkins' -> 'Security' -> 'Git Host Key Verification Configuration' \ + and configure host key verification.\ + """)); LOGGER.log( Level.FINEST, "Known hosts file {0} not found, but verifying host keys with known hosts file", diff --git a/src/main/java/org/jenkinsci/plugins/gitclient/verifier/ManuallyProvidedKeyVerifier.java b/src/main/java/org/jenkinsci/plugins/gitclient/verifier/ManuallyProvidedKeyVerifier.java index 57d3c3667b..89f42f38fb 100644 --- a/src/main/java/org/jenkinsci/plugins/gitclient/verifier/ManuallyProvidedKeyVerifier.java +++ b/src/main/java/org/jenkinsci/plugins/gitclient/verifier/ManuallyProvidedKeyVerifier.java @@ -34,11 +34,11 @@ public AbstractCliGitHostKeyVerifier forCliGit(TaskListener listener) { if (File.pathSeparatorChar == ';') { // check whether on Windows or not without sending Functions over remoting // no escaping for windows because created temp file can't contain spaces - userKnownHostsFileFlag = String.format(" -o UserKnownHostsFile=%s", escapePath(tempKnownHosts)); + userKnownHostsFileFlag = " -o UserKnownHostsFile=%s".formatted(escapePath(tempKnownHosts)); } else { // escaping needed in case job name contains spaces userKnownHostsFileFlag = - String.format(" -o UserKnownHostsFile=\\\"\"\"%s\\\"\"\"", escapePath(tempKnownHosts)); + " -o UserKnownHostsFile=\\\"\"\"%s\\\"\"\"".formatted(escapePath(tempKnownHosts)); } return "-o StrictHostKeyChecking=yes " + userKnownHostsFileFlag; }; diff --git a/src/main/java/org/jenkinsci/plugins/gitclient/verifier/SshHostKeyVerificationStrategy.java b/src/main/java/org/jenkinsci/plugins/gitclient/verifier/SshHostKeyVerificationStrategy.java index ecb05b6a6e..b14b1a6ad0 100644 --- a/src/main/java/org/jenkinsci/plugins/gitclient/verifier/SshHostKeyVerificationStrategy.java +++ b/src/main/java/org/jenkinsci/plugins/gitclient/verifier/SshHostKeyVerificationStrategy.java @@ -4,7 +4,7 @@ import hudson.model.AbstractDescribableImpl; import hudson.model.Descriptor; import java.io.File; -import java.nio.file.Paths; +import java.nio.file.Path; import jenkins.model.Jenkins; import org.apache.commons.lang.StringUtils; @@ -12,7 +12,7 @@ public abstract class SshHostKeyVerificationStrategy> implements ExtensionPoint { public static final String KNOWN_HOSTS_DEFAULT = - Paths.get(System.getProperty("user.home"), ".ssh", "known_hosts").toString(); + Path.of(System.getProperty("user.home"), ".ssh", "known_hosts").toString(); private static final String JGIT_KNOWN_HOSTS_PROPERTY = SshHostKeyVerificationStrategy.class.getName() + ".jgit_known_hosts_file"; private static final String JGIT_KNOWN_HOSTS_FILE_PATH = diff --git a/src/test/java/jmh/benchmark/BenchmarkRunner.java b/src/test/java/jmh/benchmark/BenchmarkRunner.java index e49b763685..e62ae62938 100644 --- a/src/test/java/jmh/benchmark/BenchmarkRunner.java +++ b/src/test/java/jmh/benchmark/BenchmarkRunner.java @@ -2,7 +2,7 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; -import java.nio.file.Paths; +import java.nio.file.Path; import java.util.concurrent.TimeUnit; import jenkins.benchmark.jmh.BenchmarkFinder; import org.junit.Test; @@ -29,7 +29,7 @@ private boolean shouldRunBenchmarks() throws Exception { public void runJmhBenchmarks() throws Exception { if (!shouldRunBenchmarks()) { String msg = "{\"benchmark.run\": false, \"reason\": \"Benchmark not run because benchmark.run is false\"}"; - Files.write(Paths.get("jmh-report.json"), msg.getBytes(StandardCharsets.UTF_8)); + Files.write(Path.of("jmh-report.json"), msg.getBytes(StandardCharsets.UTF_8)); return; } ChainedOptionsBuilder options = new OptionsBuilder() diff --git a/src/test/java/jmh/benchmark/FolderForBenchmark.java b/src/test/java/jmh/benchmark/FolderForBenchmark.java index 4dabd43f05..1be0073931 100644 --- a/src/test/java/jmh/benchmark/FolderForBenchmark.java +++ b/src/test/java/jmh/benchmark/FolderForBenchmark.java @@ -92,8 +92,11 @@ public File newFolder(String... folderNames) throws IOException { private void validateFolderName(String folderName) throws IOException { File tempFile = new File(folderName); if (tempFile.getParent() != null) { - String errorMsg = "Folder name cannot consist of multiple path components separated by a file separator." - + " Please use newFolder('MyParentFolder','MyFolder') to create hierarchies of folders"; + String errorMsg = + """ + Folder name cannot consist of multiple path components separated by a file separator.\ + Please use newFolder('MyParentFolder','MyFolder') to create hierarchies of folders\ + """; throw new IOException(errorMsg); } } diff --git a/src/test/java/org/jenkinsci/plugins/gitclient/FilePermissionsTest.java b/src/test/java/org/jenkinsci/plugins/gitclient/FilePermissionsTest.java index 5fd659a5d9..71c1d3d23b 100644 --- a/src/test/java/org/jenkinsci/plugins/gitclient/FilePermissionsTest.java +++ b/src/test/java/org/jenkinsci/plugins/gitclient/FilePermissionsTest.java @@ -121,7 +121,7 @@ private static File cloneTestRepo(File repo) throws Exception { } private static void verifyFile(File repo, int staticPerm) throws IOException { - String fileName = String.format("git-%03o.txt", staticPerm); + String fileName = "git-%03o.txt".formatted(staticPerm); File file = new File(repo, fileName); assertTrue("Missing " + file.getAbsolutePath(), file.exists()); String content = Files.readString(file.toPath(), StandardCharsets.UTF_8); @@ -167,7 +167,7 @@ public void posixPermissionTest() throws IOException, GitException, InterruptedE } private String getFileName() { - return String.format("git-%03o.txt", permission); + return "git-%03o.txt".formatted(permission); } private void addFile() throws IOException, GitException, InterruptedException { @@ -184,7 +184,7 @@ private void addFile() throws IOException, GitException, InterruptedException { Path path = FileSystems.getDefault().getPath(added.getPath()); assertEquals(path, Files.setPosixFilePermissions(path, filePerms(permission))); git.add(fileName); - git.commit(String.format("Perms %03o %s", permission, fileName)); + git.commit("Perms %03o %s".formatted(permission, fileName)); } private void modifyFile() throws IOException, GitException, InterruptedException { diff --git a/src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestUpdate.java b/src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestUpdate.java index 38551d401f..359681f0fc 100644 --- a/src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestUpdate.java +++ b/src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestUpdate.java @@ -288,8 +288,8 @@ String contentOf(String path) throws IOException { * JGit impl. */ CliGitAPIImpl cgit() throws Exception { - if (git instanceof CliGitAPIImpl) { - return (CliGitAPIImpl) git; + if (git instanceof CliGitAPIImpl impl) { + return impl; } if (cachedCliGitAPIImpl != null) { return cachedCliGitAPIImpl; @@ -495,23 +495,24 @@ public void tearDown() throws Exception { private void checkGetHeadRev(String remote, String branchSpec, ObjectId expectedObjectId) throws Exception { ObjectId actualObjectId = w.git.getHeadRev(remote, branchSpec); assertNotNull( - String.format( - "Expected ObjectId is null expectedObjectId '%s', remote '%s', branchSpec '%s'.", - expectedObjectId, remote, branchSpec), + "Expected ObjectId is null expectedObjectId '%s', remote '%s', branchSpec '%s'." + .formatted(expectedObjectId, remote, branchSpec), expectedObjectId); assertNotNull( - String.format( - "Actual ObjectId is null. expectedObjectId '%s', remote '%s', branchSpec '%s'.", - expectedObjectId, remote, branchSpec), + "Actual ObjectId is null. expectedObjectId '%s', remote '%s', branchSpec '%s'." + .formatted(expectedObjectId, remote, branchSpec), actualObjectId); assertEquals( - String.format( - "Actual ObjectId differs from expected one for branchSpec '%s', remote '%s':\n" - + "Actual %s,\nExpected %s\n", - branchSpec, - remote, - StringUtils.join(getBranches(actualObjectId), ", "), - StringUtils.join(getBranches(expectedObjectId), ", ")), + (""" + Actual ObjectId differs from expected one for branchSpec '%s', remote '%s': + Actual %s, + Expected %s + """) + .formatted( + branchSpec, + remote, + StringUtils.join(getBranches(actualObjectId), ", "), + StringUtils.join(getBranches(expectedObjectId), ", ")), expectedObjectId, actualObjectId); } @@ -1001,9 +1002,11 @@ public void testGetSubmodules() throws Exception { .execute(); List r = w.git.getSubmodules("HEAD"); assertEquals( - "[IndexEntry[mode=160000,type=commit,file=modules/firewall,object=978c8b223b33e203a5c766ecf79704a5ea9b35c8], " - + "IndexEntry[mode=160000,type=commit,file=modules/ntp,object=b62fabbc2bb37908c44ded233e0f4bf479e45609], " - + "IndexEntry[mode=160000,type=commit,file=modules/sshkeys,object=689c45ed57f0829735f9a2b16760c14236fe21d9]]", + """ + [IndexEntry[mode=160000,type=commit,file=modules/firewall,object=978c8b223b33e203a5c766ecf79704a5ea9b35c8], \ + IndexEntry[mode=160000,type=commit,file=modules/ntp,object=b62fabbc2bb37908c44ded233e0f4bf479e45609], \ + IndexEntry[mode=160000,type=commit,file=modules/sshkeys,object=689c45ed57f0829735f9a2b16760c14236fe21d9]]\ + """, r.toString()); w.git.submoduleInit(); w.git.submoduleUpdate().execute(); @@ -1032,7 +1035,7 @@ public void testSubmoduleUpdateShallow() throws Exception { boolean hasShallowSubmoduleSupport = w.git instanceof CliGitAPIImpl && w.cgit().isAtLeastVersion(1, 8, 4, 0); - String shallow = Paths.get(".git", "modules", "submodule", "shallow").toString(); + String shallow = Path.of(".git", "modules", "submodule", "shallow").toString(); assertEquals("shallow file existence: " + shallow, hasShallowSubmoduleSupport, w.exists(shallow)); int localSubmoduleCommits = @@ -1060,7 +1063,7 @@ public void testSubmoduleUpdateShallowWithDepth() throws Exception { boolean hasShallowSubmoduleSupport = w.git instanceof CliGitAPIImpl && w.cgit().isAtLeastVersion(1, 8, 4, 0); - String shallow = Paths.get(".git", "modules", "submodule", "shallow").toString(); + String shallow = Path.of(".git", "modules", "submodule", "shallow").toString(); assertEquals("shallow file existence: " + shallow, hasShallowSubmoduleSupport, w.exists(shallow)); int localSubmoduleCommits = @@ -2063,9 +2066,9 @@ private WorkingArea setupRepositoryWithSubmodule() throws Exception { WorkingArea submoduleWorkingArea = new WorkingArea(submoduleDir).init(); for (int commit = 1; commit <= 5; commit++) { - submoduleWorkingArea.touch("file", String.format("submodule content-%d", commit)); + submoduleWorkingArea.touch("file", "submodule content-%d".formatted(commit)); submoduleWorkingArea.cgit().add("file"); - submoduleWorkingArea.cgit().commit(String.format("submodule commit-%d", commit)); + submoduleWorkingArea.cgit().commit("submodule commit-%d".formatted(commit)); } WorkingArea repositoryWorkingArea = new WorkingArea(repositoryDir).init(); diff --git a/src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestUpdateCliGit.java b/src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestUpdateCliGit.java index 762d71499d..51dbcb76c3 100644 --- a/src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestUpdateCliGit.java +++ b/src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestUpdateCliGit.java @@ -8,7 +8,7 @@ import hudson.plugins.git.GitException; import java.io.File; -import java.nio.file.Paths; +import java.nio.file.Path; import java.util.Arrays; import java.util.Collections; import java.util.UUID; @@ -38,7 +38,7 @@ public void testSubmoduleUpdate() throws Exception { } assertFixSubmoduleUrlsThrows(); - String shallow = Paths.get(".git", "modules", "module", "1", "shallow").toString(); + String shallow = Path.of(".git", "modules", "module", "1", "shallow").toString(); assertFalse("shallow file existence: " + shallow, w.exists(shallow)); } diff --git a/src/test/java/org/jenkinsci/plugins/gitclient/GitClientMaintenanceTest.java b/src/test/java/org/jenkinsci/plugins/gitclient/GitClientMaintenanceTest.java index 7876ca82fa..678d1990c5 100644 --- a/src/test/java/org/jenkinsci/plugins/gitclient/GitClientMaintenanceTest.java +++ b/src/test/java/org/jenkinsci/plugins/gitclient/GitClientMaintenanceTest.java @@ -168,8 +168,7 @@ public void setGitClient() throws Exception { "Vojtěch GitClientMaintenanceTest Zweibrücken-Šafařík", "email.from.git.client.maintenance@example.com"); - if (gitClient instanceof CliGitAPIImpl) { - CliGitAPIImpl cliGitClient = (CliGitAPIImpl) gitClient; + if (gitClient instanceof CliGitAPIImpl cliGitClient) { if (!cliGitClient.isAtLeastVersion(1, 8, 0, 0)) { incrementalRepackSupported = false; commitGraphSupported = false; @@ -218,7 +217,7 @@ private void commitSeveralFiles() throws Exception { } private ObjectId commitOneFile(final String commitMessage) throws Exception { - final String content = String.format("A random maintenance UUID: %s\n", UUID.randomUUID()); + final String content = "A random maintenance UUID: %s\n".formatted(UUID.randomUUID()); return commitFile("One-Maintenance-File.txt", content, commitMessage); } diff --git a/src/test/java/org/jenkinsci/plugins/gitclient/GitClientSecurityTest.java b/src/test/java/org/jenkinsci/plugins/gitclient/GitClientSecurityTest.java index fd39d46631..1bdcc4414b 100644 --- a/src/test/java/org/jenkinsci/plugins/gitclient/GitClientSecurityTest.java +++ b/src/test/java/org/jenkinsci/plugins/gitclient/GitClientSecurityTest.java @@ -108,11 +108,11 @@ private static boolean enableRemoteCheck(String attack) { @Parameterized.Parameters(name = "{1},{0}") public static Collection testConfiguration() { - markerFileName = String.format(markerFileName, CONFIG_RANDOM.nextInt()); // Unique enough file name + markerFileName = markerFileName.formatted(CONFIG_RANDOM.nextInt()); // Unique enough file name List arguments = new ArrayList<>(); for (String prefix : BAD_REMOTE_URL_PREFIXES) { /* insert markerFileName into test data */ - String formattedPrefix = String.format(prefix, markerFileName); + String formattedPrefix = prefix.formatted(markerFileName); /* Random remote URL with prefix */ String firstChar = CONFIG_RANDOM.nextBoolean() ? " " : ""; diff --git a/src/test/java/org/jenkinsci/plugins/gitclient/GitClientTest.java b/src/test/java/org/jenkinsci/plugins/gitclient/GitClientTest.java index 30ddf07c0d..51997bcdcf 100644 --- a/src/test/java/org/jenkinsci/plugins/gitclient/GitClientTest.java +++ b/src/test/java/org/jenkinsci/plugins/gitclient/GitClientTest.java @@ -39,7 +39,6 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -125,8 +124,8 @@ public GitClientTest(final String gitImplName) throws Exception { .getClient(); CliGitAPIImpl cliGitClient; - if (this.srcGitClient instanceof CliGitAPIImpl) { - cliGitClient = (CliGitAPIImpl) this.srcGitClient; + if (this.srcGitClient instanceof CliGitAPIImpl impl) { + cliGitClient = impl; } else { cliGitClient = (CliGitAPIImpl) Git.with(TaskListener.NULL, new EnvVars()) .in(srcRepoDir) @@ -314,8 +313,7 @@ public void setGitClient() throws Exception { * not a threat to these tests. */ private void allowFileProtocol(GitClient client) throws Exception { - if (client instanceof CliGitAPIImpl) { - CliGitAPIImpl cliGit = (CliGitAPIImpl) client; + if (client instanceof CliGitAPIImpl cliGit) { cliGit.allowFileProtocol(); } } @@ -327,7 +325,7 @@ private ObjectId commitOneFile() throws Exception { } private ObjectId commitOneFile(final String commitMessage) throws Exception { - final String content = String.format("A random UUID: %s\n", UUID.randomUUID()); + final String content = "A random UUID: %s\n".formatted(UUID.randomUUID()); return commitFile("One-File.txt", content, commitMessage); } @@ -388,18 +386,21 @@ private String randomEmail(String name) { public void testChangelogVeryLong() throws Exception { final String gitMessage = - "Uno Dos Tres Cuatro Cinco Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut " - + "posuere tellus eu efficitur tristique. In iaculis neque in dolor vulputate" - + "sollicitudin eget a quam. Donec finibus sapien quis lectus euismod facilisis. Integer" - + "massa purus, scelerisque id iaculis ut, blandit vitae velit. Pellentesque lobortis" - + "aliquet felis, vel laoreet ipsum tincidunt at. Mauris tellus est, cursus vitae ex" - + "eget, venenatis auctor eros. Sed sagittis porta odio. Donec ut interdum massa. Aliquam" - + "sagittis, mi sit amet sollicitudin elementum, velit quam eleifend nisl, in rhoncus" - + "felis nibh eu nibh. Class aptent taciti sociosqu ad litora torquent per conubia " - + "nostra, per inceptos himenaeos." - + "\nseis\n" - + "\nasfasfasfasf\n"; - final String content = String.format("A random UUID: %s\n", UUID.randomUUID()); + """ + Uno Dos Tres Cuatro Cinco Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut \ + posuere tellus eu efficitur tristique. In iaculis neque in dolor vulputate\ + sollicitudin eget a quam. Donec finibus sapien quis lectus euismod facilisis. Integer\ + massa purus, scelerisque id iaculis ut, blandit vitae velit. Pellentesque lobortis\ + aliquet felis, vel laoreet ipsum tincidunt at. Mauris tellus est, cursus vitae ex\ + eget, venenatis auctor eros. Sed sagittis porta odio. Donec ut interdum massa. Aliquam\ + sagittis, mi sit amet sollicitudin elementum, velit quam eleifend nisl, in rhoncus\ + felis nibh eu nibh. Class aptent taciti sociosqu ad litora torquent per conubia \ + nostra, per inceptos himenaeos. + seis + + asfasfasfasf + """; + final String content = "A random UUID: %s\n".formatted(UUID.randomUUID()); ObjectId message = commitFile("One-File.txt", content, gitMessage); ChangelogCommand changelog = gitClient.changelog(); @@ -1776,9 +1777,12 @@ public void testCheckoutWithoutLFSWhenLFSNotAvailable() throws Exception { File uuidFile = new File(repoRoot, "uuid.txt"); String fileContent = Files.readString(uuidFile.toPath(), StandardCharsets.UTF_8).trim(); - String expectedContent = "version https://git-lfs.github.com/spec/v1\n" - + "oid sha256:75d122e4160dc91480257ff72403e77ef276e24d7416ed2be56d4e726482d86e\n" - + "size 33"; + String expectedContent = + """ + version https://git-lfs.github.com/spec/v1 + oid sha256:75d122e4160dc91480257ff72403e77ef276e24d7416ed2be56d4e726482d86e + size 33\ + """; assertEquals("Incorrect non-LFS file contents in " + uuidFile, expectedContent, fileContent); } @@ -2452,12 +2456,12 @@ private void assertBranches(GitClient client, String... expectedBranchNames) */ private void enableLongPaths(GitClient gitClient) throws Exception { CliGitAPIImpl cliGitClient; - if (gitClient instanceof CliGitAPIImpl && isWindows()) { + if (gitClient instanceof CliGitAPIImpl impl && isWindows()) { /* Enable core.longpaths prior to fetch on Windows - * testSubmodulesUsedFromOtherBranches submodule test will * fail with default Windows location otherwise */ - cliGitClient = (CliGitAPIImpl) gitClient; + cliGitClient = impl; cliGitClient.launchCommand("config", "core.longpaths", "true"); } } @@ -2562,7 +2566,7 @@ public void testSubmoduleUrlEndsWithDotUrl() throws Exception { gitCmd.initializeRepository("Vojtěch GitClientTest Zweibrücken-Šafařík", "email.from.git.client@example.com"); File readme = new File(urlRepoDir, "readme"); String readmeText = "This repo includes .url in its directory name (" + random.nextInt() + ")"; - Files.write(Paths.get(readme.getAbsolutePath()), readmeText.getBytes()); + Files.write(Path.of(readme.getAbsolutePath()), readmeText.getBytes()); urlRepoClient.add("readme"); urlRepoClient.commit("Added README to repo used as a submodule"); /* Enable long paths to prevent checkout failure on default Windows workspace with MSI installer */ @@ -2585,7 +2589,7 @@ public void testSubmoduleUrlEndsWithDotUrl() throws Exception { File hasSubmoduleReadme = new File(repoHasSubmodule, "readme"); String hasSubmoduleReadmeText = "Repo has a submodule that includes .url in its directory name (" + random.nextInt() + ")"; - Files.write(Paths.get(hasSubmoduleReadme.getAbsolutePath()), hasSubmoduleReadmeText.getBytes()); + Files.write(Path.of(hasSubmoduleReadme.getAbsolutePath()), hasSubmoduleReadmeText.getBytes()); repoHasSubmoduleClient.add("readme"); repoHasSubmoduleClient.commit("Added README to repo that will include a submodule whose URL ends in '.url'"); String moduleDirBaseName = "module.named.url"; @@ -3324,6 +3328,7 @@ public void test_git_branch_with_line_breaks_and_long_strings() throws Exception if (!gitImplName.equals("git")) { return; } + // Embedded \r (carriage return) must be retained in the gitBranchOutput String gitBranchOutput = "* (HEAD detached at b297853) b297853e667d5989801937beea30fcec7d1d2595 Commit message with line breaks\r very-long-string-with-more-than-44-characters\n" + " remotes/origin/master e0d3f46c4fdb8acd068b6b127356931411d16e23 Commit message with line breaks\r very-long-string-with-more-than-44-characters and some more text\n" diff --git a/src/test/java/org/jenkinsci/plugins/gitclient/NetrcTest.java b/src/test/java/org/jenkinsci/plugins/gitclient/NetrcTest.java index 947dd79982..7a0c6dba1f 100644 --- a/src/test/java/org/jenkinsci/plugins/gitclient/NetrcTest.java +++ b/src/test/java/org/jenkinsci/plugins/gitclient/NetrcTest.java @@ -7,7 +7,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.nio.file.Files; -import java.nio.file.Paths; +import java.nio.file.Path; import org.apache.commons.io.IOUtils; import org.apache.http.auth.Credentials; import org.apache.http.auth.UsernamePasswordCredentials; @@ -80,15 +80,15 @@ private void assertCredentials(TestHost host, Credentials cred) { } private void copyFileContents(String source, String destination) throws IOException { - try (InputStream sourceStream = Files.newInputStream(Paths.get(source)); - OutputStream out = Files.newOutputStream(Paths.get(destination))) { + try (InputStream sourceStream = Files.newInputStream(Path.of(source)); + OutputStream out = Files.newOutputStream(Path.of(destination))) { IOUtils.copy(sourceStream, out); } } private void copyResourceContents(String resource, String destination) throws IOException { try (InputStream sourceStream = this.getClass().getClassLoader().getResourceAsStream(resource); - OutputStream out = Files.newOutputStream(Paths.get(destination))) { + OutputStream out = Files.newOutputStream(Path.of(destination))) { IOUtils.copy(sourceStream, out); } } diff --git a/src/test/java/org/jenkinsci/plugins/gitclient/jgit/AuthzTest.java b/src/test/java/org/jenkinsci/plugins/gitclient/jgit/AuthzTest.java index 019a18d96a..9a65342b7a 100644 --- a/src/test/java/org/jenkinsci/plugins/gitclient/jgit/AuthzTest.java +++ b/src/test/java/org/jenkinsci/plugins/gitclient/jgit/AuthzTest.java @@ -104,19 +104,15 @@ public void httpWithPassword() throws Exception { protected void testRepo(StandardCredentials standardCredentials, GenericContainer containerUnderTest) throws Exception { String repoUrl = null; - if (containerUnderTest instanceof GitServerContainer) { - repoUrl = ((GitServerContainer) containerUnderTest) - .getGitRepoURIAsSSH() - .toString(); + if (containerUnderTest instanceof GitServerContainer container) { + repoUrl = container.getGitRepoURIAsSSH().toString(); // ssh://git@localhost:33011/srv/git/someRepo.git // we don't want the user part of the uri or jgit will use this user // and we want to be sure to test our implementation with dynamic user repoUrl = StringUtils.remove(repoUrl, "git@"); } - if (containerUnderTest instanceof GitHttpServerContainer) { - repoUrl = ((GitHttpServerContainer) containerUnderTest) - .getGitRepoURIAsHttp() - .toString(); + if (containerUnderTest instanceof GitHttpServerContainer container) { + repoUrl = container.getGitRepoURIAsHttp().toString(); } Path testRepo = testFolder.newFolder().toPath(); diff --git a/src/test/java/org/jenkinsci/plugins/gitclient/verifier/AcceptFirstConnectionVerifierTest.java b/src/test/java/org/jenkinsci/plugins/gitclient/verifier/AcceptFirstConnectionVerifierTest.java index 7a4a0d7fcd..42e24b2030 100644 --- a/src/test/java/org/jenkinsci/plugins/gitclient/verifier/AcceptFirstConnectionVerifierTest.java +++ b/src/test/java/org/jenkinsci/plugins/gitclient/verifier/AcceptFirstConnectionVerifierTest.java @@ -25,14 +25,19 @@ public class AcceptFirstConnectionVerifierTest { - private static final String FILE_CONTENT = "|1|4MiAohNAs5mYhPnYkpnOUWXmMTA=|iKR8xF3kCEdmSch/QtdXfdjWMCo=" - + " ssh-ed25519" - + " AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl"; + private static final String FILE_CONTENT = + """ + |1|4MiAohNAs5mYhPnYkpnOUWXmMTA=|iKR8xF3kCEdmSch/QtdXfdjWMCo=\ + ssh-ed25519\ + AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl\ + """; private static final String KEY_ecdsa_sha2_nistp256 = - "|1|owDOW+8aankl2aFSPKPIXsIf31E=|lGZ9BEWUfa9HoQteyYE5wIqHJdo=,|1|eGv/ezgtZ9YMw7OHcykKKOvAINk=|3lpkF7XiveRl/D7XvTOMc3ra2kU=" - + " ecdsa-sha2-nistp256" - + " AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg="; + """ + |1|owDOW+8aankl2aFSPKPIXsIf31E=|lGZ9BEWUfa9HoQteyYE5wIqHJdo=,|1|eGv/ezgtZ9YMw7OHcykKKOvAINk=|3lpkF7XiveRl/D7XvTOMc3ra2kU=\ + ecdsa-sha2-nistp256\ + AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=\ + """; @Rule public TemporaryFolder testFolder = @@ -136,9 +141,12 @@ public void testVerifyServerHostKeyWhenSecondConnectionWhenNotDefaultAlgorithm() if (isKubernetesCI()) { return; // Test fails with connection timeout on ci.jenkins.io kubernetes agents } - String fileContent = "github.com,140.82.121.4" - + " ecdsa-sha2-nistp256" - + " AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg="; + String fileContent = + """ + github.com,140.82.121.4\ + ecdsa-sha2-nistp256\ + AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=\ + """; File mockedKnownHosts = knownHostsTestUtil.createFakeKnownHosts(fileContent); AcceptFirstConnectionVerifier acceptFirstConnectionVerifier = spy(new AcceptFirstConnectionVerifier()); when(acceptFirstConnectionVerifier.getKnownHostsFile()).thenReturn(mockedKnownHosts); @@ -163,9 +171,12 @@ public void testVerifyServerHostKeyWhenSecondConnectionWhenNotDefaultAlgorithm() @Test @Ignore("FIXME not sure what is the test here") public void testVerifyServerHostKeyWhenSecondConnectionWithNonEqualKeys() throws Exception { - String fileContent = "|1|f7esvmtaiBk+EMHjPzWbRYRpBPY=|T7Qe4QAksYPZPwYEx5QxQykSjfc=" // github.com:22 - + " ssh-ed25519" - + " AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9OOOO"; + String fileContent = + """ + |1|f7esvmtaiBk+EMHjPzWbRYRpBPY=|T7Qe4QAksYPZPwYEx5QxQykSjfc=\ + ssh-ed25519\ + AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9OOOO\ + """; File mockedKnownHosts = knownHostsTestUtil.createFakeKnownHosts(fileContent); // file was created during first connection AcceptFirstConnectionVerifier acceptFirstConnectionVerifier = spy(new AcceptFirstConnectionVerifier()); @@ -193,9 +204,12 @@ public void testVerifyServerHostKeyWhenConnectionWithAnotherHost() throws Except if (isKubernetesCI()) { return; // Test fails with connection timeout on ci.jenkins.io kubernetes agents } - String bitbucketFileContent = "|1|HnmPCP38pBhCY0NUtBXSraOg9pM=|L6YZ9asEeb2xplTDEThGOxRq7ZY=" - + " ssh-rsa" - + " AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw=="; + String bitbucketFileContent = + """ + |1|HnmPCP38pBhCY0NUtBXSraOg9pM=|L6YZ9asEeb2xplTDEThGOxRq7ZY=\ + ssh-rsa\ + AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==\ + """; File fakeKnownHosts = knownHostsTestUtil.createFakeKnownHosts(bitbucketFileContent); AcceptFirstConnectionVerifier acceptFirstConnectionVerifier = spy(new AcceptFirstConnectionVerifier()); @@ -225,9 +239,12 @@ public void testVerifyServerHostKeyWhenHostnamePortProvided() throws Exception { if (isKubernetesCI()) { return; // Test fails with connection timeout on ci.jenkins.io kubernetes agents } - String fileContent = "|1|6uMj3M7sLgZpn54vQbGqgPNTCVM=|OkV9Lu9REJZR5QCVrITAIY34I1M=" // github.com:59666 - + " ssh-ed25519" - + " AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl"; + String fileContent = + """ + |1|6uMj3M7sLgZpn54vQbGqgPNTCVM=|OkV9Lu9REJZR5QCVrITAIY34I1M=\ + ssh-ed25519\ + AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl\ + """; File mockedKnownHosts = knownHostsTestUtil.createFakeKnownHosts(fileContent); AcceptFirstConnectionVerifier acceptFirstConnectionVerifier = spy(new AcceptFirstConnectionVerifier()); when(acceptFirstConnectionVerifier.getKnownHostsFile()).thenReturn(mockedKnownHosts); diff --git a/src/test/java/org/jenkinsci/plugins/gitclient/verifier/KnownHostsFileVerifierTest.java b/src/test/java/org/jenkinsci/plugins/gitclient/verifier/KnownHostsFileVerifierTest.java index 714ec46c5b..6d22bf9408 100644 --- a/src/test/java/org/jenkinsci/plugins/gitclient/verifier/KnownHostsFileVerifierTest.java +++ b/src/test/java/org/jenkinsci/plugins/gitclient/verifier/KnownHostsFileVerifierTest.java @@ -22,9 +22,12 @@ @RunWith(MockitoJUnitRunner.class) public class KnownHostsFileVerifierTest { - private static final String FILE_CONTENT = "github.com" - + " ecdsa-sha2-nistp256" - + " AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg="; + private static final String FILE_CONTENT = + """ + github.com\ + ecdsa-sha2-nistp256\ + AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=\ + """; // Create a temporary folder and assert folder deletion at end of tests @Rule diff --git a/src/test/java/org/jenkinsci/plugins/gitclient/verifier/KnownHostsTestUtil.java b/src/test/java/org/jenkinsci/plugins/gitclient/verifier/KnownHostsTestUtil.java index 7ce011349d..d28bdbfa42 100644 --- a/src/test/java/org/jenkinsci/plugins/gitclient/verifier/KnownHostsTestUtil.java +++ b/src/test/java/org/jenkinsci/plugins/gitclient/verifier/KnownHostsTestUtil.java @@ -11,7 +11,7 @@ import java.net.SocketAddress; import java.nio.charset.StandardCharsets; import java.nio.file.Files; -import java.nio.file.Paths; +import java.nio.file.Path; import java.security.PublicKey; import java.time.Duration; import java.util.ArrayList; @@ -81,7 +81,7 @@ protected static JGitClientSession connectToHost( try (SshClient client = ClientBuilder.builder() .factory(JGitSshClient::new) - .hostConfigEntryResolver(new ConfigFileHostEntryResolver(Paths.get("src/test/resources/ssh_config"))) + .hostConfigEntryResolver(new ConfigFileHostEntryResolver(Path.of("src/test/resources/ssh_config"))) .serverKeyVerifier(new JGitServerKeyVerifier(verifier.getServerKeyDatabase())) .compressionFactories(new ArrayList<>(BuiltinCompressions.VALUES)) .build()) { @@ -118,14 +118,13 @@ protected static boolean checkKeys(JGitClientSession s) { } boolean verified = false; - if (serverKey instanceof OpenSshCertificate) { + if (serverKey instanceof OpenSshCertificate certificate) { // check if we trust the CA - verified = - serverKeyVerifier.verifyServerKey(s, remoteAddress, ((OpenSshCertificate) serverKey).getCaPubKey()); + verified = serverKeyVerifier.verifyServerKey(s, remoteAddress, certificate.getCaPubKey()); if (!verified) { // fallback to actual public host key - serverKey = ((OpenSshCertificate) serverKey).getCertPubKey(); + serverKey = certificate.getCertPubKey(); } } diff --git a/src/test/java/org/jenkinsci/plugins/gitclient/verifier/NoHostKeyVerifierTest.java b/src/test/java/org/jenkinsci/plugins/gitclient/verifier/NoHostKeyVerifierTest.java index d2a7bdf327..3cb2e8ba68 100644 --- a/src/test/java/org/jenkinsci/plugins/gitclient/verifier/NoHostKeyVerifierTest.java +++ b/src/test/java/org/jenkinsci/plugins/gitclient/verifier/NoHostKeyVerifierTest.java @@ -7,7 +7,7 @@ import hudson.model.StreamBuildListener; import hudson.model.TaskListener; import java.io.IOException; -import java.nio.file.Paths; +import java.nio.file.Path; import java.time.Duration; import org.awaitility.Awaitility; import org.junit.Before; @@ -48,7 +48,7 @@ public void verifyServerHostKey() throws IOException { @Test public void testVerifyHostKeyOption() throws IOException { assertThat( - verifier.forCliGit(TaskListener.NULL).getVerifyHostKeyOption(Paths.get("")), + verifier.forCliGit(TaskListener.NULL).getVerifyHostKeyOption(Path.of("")), is("-o StrictHostKeyChecking=no")); } } From da6c15f17ad1849328c59800ec20c0c6bfb040cc Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Tue, 17 Sep 2024 21:07:18 -0600 Subject: [PATCH 11/13] Require Jenkins 2.477 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7e466308ab..18a8e0627f 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 2.462 - 2.476 + 2.477 7.0.0.202409031743-r 2265.v3da_49c8134d6 From 62ddbe052ef85f0d031c291799043b6a43b5bc97 Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Tue, 17 Sep 2024 21:08:42 -0600 Subject: [PATCH 12/13] Use test harness that drops EE 8 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 18a8e0627f..b558493e98 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ 2.477 7.0.0.202409031743-r - 2265.v3da_49c8134d6 + 2272.v5db_817b_a_6f0d 17 Max Low From 6da4ecd4cd231af23257b578cdcbd1bb964d50dd Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Fri, 20 Sep 2024 15:46:05 -0600 Subject: [PATCH 13/13] Use Jenkins test harness 2289.x --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9d5ea7c9bc..b1612a4373 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ 2.477 7.0.0.202409031743-r - 2272.v5db_817b_a_6f0d + 2289.vfd344a_6d1660 17 Max Low