-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use JGit 7.0.0, require Java 17 and Jenkins 2.463 or newer #1170
Conversation
3b8f18e
to
b97ab86
Compare
6bfa95c
to
c14430c
Compare
jenkinsci/git-client-plugin#1170 Test JGit 7.0.0 with Java 17 JGit 7.0.0.202408202050-m3
jenkinsci/git-client-plugin#1170 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
480ce4b
to
1189a30
Compare
@jenkinsci/git-client-plugin-developers could you review and comment as necessary on this pull request? I would like to merge and release this change by the end of this week. I've been testing JGit 7.0.0 pre-releases for a long time. Now that JGit 7.0.0 is released, I'd prefer to include it in the git client plugin. The release with JGit 7.0.0 won't be shown to LTS users until the 30 Oct 2024 LTS release that requires Java 17. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Go for it!
But bear in mind Apache Mina SSHD will be released soon (before end of September)
I have done some testing the last few weeks and it was working fine with SNAPSHOT but just in case we need modification after the final release/
This change should have been preceded by a thorough review of the consumers of the JGit API within the Jenkins plugins. I've run a preliminary review using usage in plugins with the following signatures:
That set of removed method signatures leads to the following detected issues and their matching fixes:
The change also broke the git-changelog plugin but the break is not detected by usage in plugins because the git-changelog plugin uses a library that references JGit 6.x methods. Git changelog issue is: Users of the git changelog plugin will need to remain with git client 5.0.0 and JGit 6.10.0 until they upgrade to a Jenkins version that requires Java 17 or newer. The git changelog plugin will require Java 17 or newer in an upcoming release because it depends on two libraries (Eclipse JGit 7.0.0 and Java Handlebars) that require Java 17. |
https://issues.jenkins.io/browse/JENKINS-73781 notes that JGit deprecated peel() in favor of getRefDatabase().peel() a long time ago. The deprecated method was removed from JGit 7.0.0. This uses the replacement method that has been available since the deprecation. jenkinsci/git-client-plugin#1170 is the git client plugin pull request that introduced JGit 7.0.0. https://github.com/jenkinsci/git-client-plugin/releases/tag/git-client-6.0.0 is the git client plugin release that introduced JGit 7.0.0.
Looks like these changes break
|
Unfortunately, there is not much that I can do about that issue. The class The changes in the git client plugin to adapt to JGit 7.0.0 were not large, but they did require changes. The most direct workaround is to remain with Git client plugin 5.0.0 and not upgrade to Git client plugin 6.0.0 until a new version of git changelog plugin is released that has been adapted to replace the deprecated use of |
Git changelog plugin has updated the dependent library and released a new version. Users running a recent Jenkins weekly can upgrade to the new git changelog plugin version. Users running Jenkins LTS 2.462.x won't see the issue because they are not offered git client plugin 6.0.0. |
I confirm that issue with |
<jenkins.version>${jenkins.baseline}.3</jenkins.version> | ||
<jgit.version>6.10.0.202406032230-r</jgit.version> | ||
<jenkins.baseline>2.462</jenkins.baseline> | ||
<!-- TODO Replace with the standard jenkins.baseline references after LTS requires Java 17 --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This TODO can now be completed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Completed in:
https://issues.jenkins.io/browse/JENKINS-73781 notes that JGit deprecated peel() in favor of getRefDatabase().peel() a long time ago. The deprecated method was removed from JGit 7.0.0. This uses the replacement method that has been available since the deprecation. jenkinsci/git-client-plugin#1170 is the git client plugin pull request that introduced JGit 7.0.0. https://github.com/jenkinsci/git-client-plugin/releases/tag/git-client-6.0.0 is the git client plugin release that introduced JGit 7.0.0.
https://issues.jenkins.io/browse/JENKINS-73781 notes that JGit deprecated peel() in favor of getRefDatabase().peel() a long time ago. The deprecated method was removed from JGit 7.0.0. This uses the replacement method that has been available since the deprecation. jenkinsci/git-client-plugin#1170 is the git client plugin pull request that introduced JGit 7.0.0. https://github.com/jenkinsci/git-client-plugin/releases/tag/git-client-6.0.0 is the git client plugin release that introduced JGit 7.0.0.
Use JGit 7.0.0, require Java 17 and Jenkins 2.463 or newer
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.
Checklist
Types of changes
What types of changes does your code introduce? Put an
x
in the boxes that apply