-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
Implement InterceptingExecutorService
without Guava
#5565
Conversation
Usages are as follows:
From the source side, I verified that none of the open source plugins reference We also look good on the PCT side. PCT passed for Next I'll test compatibility to make sure a version of |
I built a core with this change and started it with
|
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.
I had wanted to validate the impact of this internally, but there are some other already merged changes that cause this PR to fail the testing. So give that the scm-api is still useable and should show this is good enough.
I think we do want to release note this at a developer level. mainly because it does make it obvious if you do fall into some issue in the future with a plugin that is not in any known update center. |
Jenkins core defines
jenkins.util.InterceptingExecutorService
, which extendscom.google.common.util.concurrent.ForwardingExecutorService
. This exposes a Guava API in the Jenkins public API, which is a liability. If the Guava API changed, the Jenkins API might also have to change, which could result in incompatibilities. Supporting such an API also implies that Jenkins core must expose Guava to plugins, something we would rather avoid if possible.This PR is going after the same goal as #5558 but with a different approach. The goal is to remove exposure of Guava in the Jenkins core public API. The approach taken in this PR is to directly implement
ExecutorService
rather than to extend Guava'sForwardingExecutorService
. Modulo compatibility concerns, this is the simplest option to eliminating the dependency.From a compatibility perspective this change is a bit risky, as it changes the class hierarchy for these classes:
They now no longer extend
ForwardingExecutorService
orForwardingObject
, so any attempts to cast to those types would fail. However, I doubt any such casts exist.Apart from that, I've ensured that all of the same public methods are implemented, so in theory any already compiled plugins invoking methods on these objects should continue to work as before. In practice, I think we'd want to do some sort of testing on this, but I'm not sure exactly how to test this. I'll start by trying to get an incremental build and run it through the BOM tests.
Proposed changelog entries
Developer:
InterceptingExecutorService
and its subclasses no longer extendcom.google.common.util.concurrent.ForwardingExecutorService
orcom.google.common.collect.ForwardingObject
.Proposed upgrade guidelines
N/A
Submitter checklist
Proposed changelog entries
section only if there are breaking changes or other changes which may require extra steps from users during the upgradeMaintainer checklist
Before the changes are marked as
ready-for-merge
:Proposed changelog entries
are correctupgrade-guide-needed
label is set and there is aProposed upgrade guidelines
section in the PR title. (example)lts-candidate
to be considered (see query).