Skip to content
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

[JENKINS-73781] Make plugin compatible with git client 5.0.0 and 6.0.0 #97

Merged
merged 3 commits into from
Nov 23, 2024

Conversation

MarkEWaite
Copy link
Contributor

@MarkEWaite MarkEWaite commented Sep 16, 2024

[JENKINS-73781] Make plugin compatible with git client 5.0.0 and 6.0.0

Replaces JGit peel() with getRefDatabase().peel()

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. This change works with both the older JGit versions (6.x) and the most recent JGit 7.0.0 release.

The git client plugin pull request that introduced JGit 7.0.0 is:

Git client plugin 6.0.0 is the git client plugin release that introduced JGit 7.0.0.

The test that is failing on the master branch has been updated to use the same pattern as another test in the same file. Assembla now requires authenticated access for their Subversion repositories. The shouldGetLastChangesFromLatestTag test already used this same technique to only run the test when the PASS system property is provided. Make shouldGetLastChanges the same as shouldGetLastChangesFromLatestTag.

This change ignores shouldGetLastChanges on ci.jenkins.io in the same way that shouldGetLastChangesFromLatestTag was already ignored, since the PASS property is not set on ci.jenkins.io.

Testing done

Automated tests pass. No interactive testing has been performed because the changes are minor. The same change was applied to the git client plugin when it transitioned from JGit 6.10.0 to JGit 7.0.0 and all tests were passing with git client plugin.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@MarkEWaite MarkEWaite changed the title [JENKINS-73781] Replace JGit peel() with getRefDatabase().peel() [JENKINS-73781] Replace JGit peel() with getRefDatabase().peel() Sep 16, 2024
@MarkEWaite MarkEWaite changed the title [JENKINS-73781] Replace JGit peel() with getRefDatabase().peel() [JENKINS-73781] Make plugin compatible with JGit 6.9.0, 6.10.0, and 7.0.0 Sep 23, 2024
@MarkEWaite MarkEWaite changed the title [JENKINS-73781] Make plugin compatible with JGit 6.9.0, 6.10.0, and 7.0.0 [JENKINS-73781] Make plugin compatible with git client 5.0.0 and 6.0.0 Sep 23, 2024
@MarkEWaite
Copy link
Contributor Author

@rmpestano this needs to be merged and released so that users who install Jenkins 2.463 or later do not see a last changes plugin regression due to the JGit 7.0.0 changes that are included in Git client plugin 6.0.0 and later. The changes are compatible with earlier versions of the git client plugin as well, so should be very low risk for users.

Are you available to merge and release it?

NotMyFault and others added 3 commits November 23, 2024 07:24
Assembla now requires authenticated access for their Subversion
repositories.  The shouldGetLastChangesFromLatestTag test already
used this same technique to only run the test when the PASS system
property is provided.  Make shouldGetLastChanges the same as
shouldGetLastChangesFromLatestTag.

Test fails on the master branch as well.

This change ignores shouldGetLastChanges on ci.jenkins.io in the same
way that shouldGetLastChangesFromLatestTag was already ignored.
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.
@MarkEWaite MarkEWaite force-pushed the replace-deprecated-jgit-use branch from c8a881d to 4271d1a Compare November 23, 2024 14:25
MarkEWaite added a commit to MarkEWaite/repository-permissions-updater that referenced this pull request Nov 23, 2024
jenkinsci/last-changes-plugin#97 needs to be
merged and released so that users of the last-changes plugin are not
disrupted when they upgrade to git client 5.0.0 or git client plugin
6.0.0.

$The pull request was submitted in September.  There has been no response
from @rmpestano.
jenkinsci/last-changes-plugin#97 (comment)

That pull request is a minimal change that adapts to git client plugin
5.0.0 and later without unnecessary changes.  Other changes to modernize
the plugin can be considered once the immediate issue with newer versions
of git client plugin has been resolved.

jenkinsci/last-changes-plugin#98 includes several
steps to modernize the plugin, though it has not been tested yet.
@rmpestano rmpestano merged commit 156e250 into jenkinsci:master Nov 23, 2024
13 checks passed
@rmpestano
Copy link
Contributor

@MarkEWaite thanks for stepping in, are you able to release? I don't think I have the maven setup to do that anymore

@MarkEWaite MarkEWaite deleted the replace-deprecated-jgit-use branch November 23, 2024 17:43
@MarkEWaite
Copy link
Contributor Author

@MarkEWaite thanks for stepping in, are you able to release? I don't think I have the maven setup to do that anymore

I'm not yet able to release, but will be able to release very soon, once the processing is completed from the merged pull request:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants