-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Remove Bytecode Compatibility Transformer #5526
Remove Bytecode Compatibility Transformer #5526
Conversation
For the specific fields it seems useful. I wonder about other fields in the future though. There's some stuff in OTOH if we'd never again use this feature due to the pain it's caused in the past, we can just remove it. |
I do not think we would ever want to use this again. It is unnecessarily complex and opaque, lacks automated testing, and does not interoperate well with debuggers and other IDE tooling.
I think it is time to move on. |
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.
Great! I would love to also get rid of @WithBridgeMethods
but at least that runs at build time so you can see what is going on in bytecode (still awkward for IDEs).
I suspect this also improves Jenkins startup time when lots of plugins are enabled. The transformer has short-circuit logic to avoid processing a |
I did some relatively unscientific tests with the set of plugins used at my company (133 plugins). After starting Jenkins once with this plugin set, I measured how long Jenkins took to get from cold startup to "Jenkins is fully up and running". Before this change, the results were 17.80s, 18.05s, 18.30s, 18.57s, and 19.23s (average 18.39s). After this change the results were 17.27s, 17.31s, 17.50s, 17.63s, and 18.29s (average 17.6s). So I guess I shaved off about a second on average. I'll take it! |
Not sure if that is statistically significant or not, but by inspection this change reduces startup time by some amount. Thanks! |
This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback. Thanks! |
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.
No objections from me. I am not sure what is the impact on various 3rd party and proprietary plugin. In any case, BCT is very difficult to use and maintain. Let's take a risk. In the worst case we will be able to revert the dependency or create an API plugin for it if possible
Does not make sense. |
Formally deprecating plugins left behind in jenkinsci/jenkins#5320, jenkinsci/jenkins#5338, jenkinsci/jenkins#5521, and jenkinsci/jenkins#5526.
Commit 47de54d introduced Bytecode Compatibility Transformer to allow core to do signature changes on fields that plugins might depend on. This functionality was never enabled for plugins, so there are no plugins with
org.jenkinsci.bytecode.AdaptField
annotations. The onlyorg.jenkinsci.bytecode.AdaptField
annotations are in core (I verified this withusage-in-plugins
and searching forAdaptField
in sources), and the vast majority of them have been deleted over the years. Only two fields with such annotations remain:hudson.model.Queue$Item#id
andhudson.model.AbstractProject#triggers
. Runningusage-in-plugins
againstturned up exactly two references, both to
hudson/model/Queue$Item#id
:Let's consider the cost of maintaining Bytecode Compatibility Transformer:
usage-in-plugins
and by searching in sources.)Now let's consider the benefit of maintaining Bytecode Compatibility Transformer:
hudson/model/Queue$Item#id
field.In my humble opinion, it is time to dispense with this subsystem.
Proposed changelog entries
Removed: The bytecode transformer that retains compatibility after changing public Java APIs and its associated
hudson.ClassicPluginStrategy.noBytecodeTransformer
system property have been removed.Developer: Plugins that rely on the
hudson.model.Queue$Item#id
orhudson.model.AbstractProject#triggers
fields, including Slave Prerequisites and vertx, must be updated to call the corresponding getters.Proposed upgrade guidelines
Support for plugins that rely on the
hudson.model.Queue$Item#id
orhudson.model.AbstractProject#triggers
fields, including Slave Prerequisites and vertx, has been dropped. Any such plugins must be removed prior to upgrading Jenkins. If you have customized thehudson.ClassicPluginStrategy.noBytecodeTransformer
system property, you should remove this customization.Maintainer 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).