Skip to content

Commit

Permalink
Require Jenkins 2.479 or newer (#1172)
Browse files Browse the repository at this point in the history
* 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.

* Test JGit 7.0.0 with Jakarta EE 9 Jenkins core

* Use JGit 7.0.0.202408202050-m3 pre-release

* Use JGit 7.0.0.202409031743-r

* Adapt to removed API's in JGit 7.0.0

* Use test harness 2265.x

* Next Jenkins baseline will be a .1

* 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

* Use 6.1.0 as version

* 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.

* Require Jenkins 2.477

* Use test harness that drops EE 8

* Use Jenkins test harness 2289.x

* Use test harness 2299.*

* Use parent pom 5.0

Removes a few of the workarounds since it is released.

* Security scan not ready for Java 17 and Jakarta EE 9

* Use parent pom 5.1

https://github.com/jenkinsci/plugin-pom/releases/tag/plugin-5.1 notes
that it includes a workaround the outdated ASM API inclusion that Guice
brings into Jenkins core.  Has not affected the git client plugin, but it
is good to remain current with the most recent release of the parent pom.

* Revert "Security scan not ready for Java 17 and Jakarta EE 9"

Cheeck if security scan is ready for Java 17 and Jakarta EE 9

This reverts commit 4bcca7e.

* Use StaplerRequest2 for EE 9

No need to rely on the compatibility layer for EE 8

---------

Co-authored-by: git-client-user <[email protected]>
  • Loading branch information
MarkEWaite and git-client-user authored Oct 10, 2024
1 parent c277084 commit c372608
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.88</version>
<version>5.1</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -53,7 +53,7 @@
</scm>

<properties>
<revision>6.0.1</revision>
<revision>6.1.0</revision>
<changelist>-SNAPSHOT</changelist>
<!-- Character set tests fail unless file.encoding is set -->
<argLine>-Dfile.encoding=${project.build.sourceEncoding}</argLine>
Expand All @@ -62,10 +62,8 @@
<jenkins.baseline>2.462</jenkins.baseline>
<!-- TODO Replace with the standard jenkins.baseline references after LTS requires Java 17 -->
<!-- <jenkins.version>${jenkins.baseline}.1</jenkins.version> -->
<jenkins.version>2.463</jenkins.version>
<jenkins.version>2.479</jenkins.version>
<jgit.version>7.0.0.202409031743-r</jgit.version>
<!-- TODO JENKINS-73339 until in parent POM -->
<maven.compiler.release>17</maven.compiler.release>
<spotbugs.effort>Max</spotbugs.effort>
<spotbugs.threshold>Low</spotbugs.threshold>
<spotless.check.skip>false</spotless.check.skip>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/hudson/plugins/git/GitTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;
import org.kohsuke.stapler.interceptor.RequirePOST;

/**
Expand Down Expand Up @@ -153,7 +153,7 @@ public String getDisplayName() {
}

@Override
public boolean configure(StaplerRequest req, JSONObject json) {
public boolean configure(StaplerRequest2 req, JSONObject json) {
setInstallations(req.bindJSONToList(clazz, json.get("tool")).toArray(new GitTool[0]));
save();
return true;
Expand Down

0 comments on commit c372608

Please sign in to comment.