Skip to content

Require Jenkins 2.204.1#862

Merged
MarkEWaite merged 5 commits intojenkinsci:masterfrom
MarkEWaite:require-jenkins-2.204.1
Apr 5, 2020
Merged

Require Jenkins 2.204.1#862
MarkEWaite merged 5 commits intojenkinsci:masterfrom
MarkEWaite:require-jenkins-2.204.1

Conversation

@MarkEWaite
Copy link
Contributor

@MarkEWaite MarkEWaite commented Apr 2, 2020

Require Jenkins 2.204.1

This pull request switches from requiring Jenkins 2.138.4 as minimum version to require Jenkins 2.204.1 as minimum version. Using a modern version like 2.204.1 includes the trilead-api separation from the Jenkins core and simplifies testing.

Checklist

  • I have read the CONTRIBUTING doc
  • I have referenced the Jira issue related to my changes in one or more commit messages
  • I have added tests that verify my changes
  • Unit tests pass locally with my changes
  • I have added documentation as necessary
  • No Javadoc warnings were introduced with my changes
  • No spotbugs warnings were introduced with my changes
  • I have interactively tested my changes
  • Any dependent changes have been merged and published in upstream modules (like git-client-plugin)

Types of changes

  • Dependency or infrastructure update

Further comments

User based justification for choosing 2.204.1 as the new minimum version:

  • Over 48% of the 240 000 installations of git plugin are running git plugin 4.0.0 or newer. Over 40 000 git plugin installations are using Jenkins 2.204.2
  • Almost 10x more installations of git plugin are on Jenkins 2.204.2 than any other single release

Users that are choosing to stay current with the git plugin are also choosing to stay current with Jenkins releases. That's a very good thing. Special thanks to the users for choosing to update to recent releases!

The Jenkinsfile is now configured to test Jenkins 2.204.6 on Windows with Java 8 and Jenkins 2.222.1 or 2.204.6 on Linux with both Java 8 and Java 11. It intentionally tests the most recent release of Jenkins 2.204.x while only requiring 2.204.1 so that users of 2.204.2 are not forced to update to use the git client plugin.

There are still some spotbugs warnings that will either need to be suppressed, resolved, or hidden by restoring the spotbugs settings that were used until the recent update to spotbugs 4.0.1. Specifically, the spotbugs threshold was previously set to 'High' with the effort set to 'Low'. The new settings invert that and set the threshold to 'Low' and the effort to 'Max'.

This change intentionally uses plugin pom 4.0-beta with the assumption that plugin pom 4.0 will be released within the next month or so. If it is not released in that time, then the most recent released parent will be used instead.

Matching pull request for git client plugin at jenkinsci/git-client-plugin#532

Fork count of 3 often fails on ci.jenkins.io with an out of memory error
in maven.  Use the default and accept slower performance on multi-core
machines.
Since the test already had a JenkinsRule, use it to make passing
and failing HTTP requests to the notifyCommit URL and to other
URL's.

Uses a single JenkinsRule for the entire class of tests, since
none of them alter the state of Jenkins enough to justify
restarting Jenkins.  Saves the time of stopping and starting
Jenkins for each test.
Intentionally made public to prevent Java 11 mocking failure
due to class loading of a non-public interface in a different
class loader than the mocking framework. Since this is a test,
it seems quite safe to make the interface slightly more visible
than private.

The message from mockito is:

The type is not public and its mock class is loaded by a different class loader.
This can have multiple reasons:
  - You are mocking a class with additional interfaces of another class loader
  - Mockito is loaded by a different class loader than the mocked type (e.g. with OSGi)
  - The thread's context class loader is different than the mock's class loader

Not clear to me why this is an issue only with the update of the minimum
Jenkins version from 2.138.4 to 2.204.1, but the change is only in
test code and only to assist a mocked test so that it continues to
be well-behaved.
@MarkEWaite
Copy link
Contributor Author

MarkEWaite commented Apr 2, 2020

Merge of this PR will need to wait until I can diagnose and resolve the test failures.

The test failures are on Windows in cleanup and build log file removal from GitStatusTest (my CI infrastrastructure) and BuildSingleRevisionOnlyTest (ci.jenkins.io) on Windows. Usually those types of test failures point to a real problem with something that is holding locks. Unfortunately, in all the cases, the file that cannot be removed is the build log file. I believe the plugin relies on Jenkins core to close the build log file after a job completes, but there may be missing calls to wait for job completion before exiting the tests that are failing.

Fixed in 02fc093 by waiting for test to complete on Windows before ending the test.

Windows job cleanup fails to delete build logs in some of these tests.
Wait for the jobs to complete before exiting the test so that the
build logs will not be active when the cleanup process tries to
delete them.

The build logs which are not being promptly released are logs that
Jenkins core maintains.  It seems like Jenkins core should be the
one that is responsible to assure the locks are released before the
test exits.  However, that might slow tests by blocking their exit
unnecessarily on platforms that allow open files to be deleted.
@MarkEWaite MarkEWaite merged commit fd96a34 into jenkinsci:master Apr 5, 2020
@MarkEWaite MarkEWaite deleted the require-jenkins-2.204.1 branch April 5, 2020 19:58
@MarkEWaite MarkEWaite added the dependencies Dependency related change label Apr 11, 2020
@jglick
Copy link
Member

jglick commented Jun 8, 2020

@MarkEWaite any plans to release this?

@MarkEWaite
Copy link
Contributor Author

MarkEWaite commented Jun 8, 2020

@jglick yes, @fcojfernandez, @rsandell and I agreed that we'll target the next release of the git plugin at roughly the same time as the release of Jenkins 2.235.1 long term support. That will deliver the user interface fixes that are also included in the master branch.

Benefits

  • Tim Jacomb and Josh Soref improvements to git plugin user interface will be available to users of Jenkins 2.235.1 at its release
  • Mike Cirioli's extended read support will be available for git plugin global configuration
  • Rishabh's plugin performance project for Google Summer of Code can be based on a modern version of Jenkins (2.204 or later) rather than the ancient history version (2.135) currently used as the minimum Jenkins version
  • Karl Shultz's Pipeline symbols will be available for git plugin pipelines [JENKINS-62130] Add Symbols to extenders of SCMSourceTrait and friends #886

Remaining Work

There are several "must have" items yet to be completed before git plugin 4.3 can be released:

There are also some "nice to have" items that would make the 4.3 release even better:

  • Add screenshots to sections of the documentation to make it more pleasant to read Add images to improve docs clarity #900
  • Add Pipeline examples to the documentation (unlikely, considering available time)

@jglick
Copy link
Member

jglick commented Jun 18, 2020

we'll target the next release of the git plugin at roughly the same time as the release of Jenkins 2.235.1

ping

@MarkEWaite
Copy link
Contributor Author

I plan to release tomorrow with the current contents of the master branch. No new symbols, but JGit 5.8 in the git client plugin and minimum Jenkins version of 2.204.1.

I'll review that plan with the git plugin performance improvement mentors tomorrow morning (@fcojfernandez , @justinharringa , and Omkar Deshpande) during our twice weekly meeting with @rishabhBudhouliya .

The pull request to add symbols recently surprised me when it caused a compatibility failure during startup. I'd initially hoped to include the additional symbols in 4.3, but don't want to delay 4.3 for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Dependency related change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants