The history is not in this plugin because the code was copied from the Flexible Publish plugin.
The original check is both necessary - and not aggressive enough. The descriptors should be filtered for those with newInstance methods too. Some plugins appear to have both DBC and newInstance!
The reason they need to be filtered is that the Flexible publish creates instances using a data bound constructor. Any instances of build step that are contained within will fail to be configured corectly if it uses configuration from the form and also uses newInstance.
- 100% of buildsteps I tested which used newInstance failed to be correctly configured when the form was submitted.*
The descriptor listers are used to enable publishers as build steps and build steps as publishers (using the Any Build Step plugin). For this reason, build steps returned need to be configurable using both configuration mechanisms.
If you believe that the newInstance will be correctly configured when contained within a DBC configured container, please add a unit test to the Any Build Step plugin showing successful configuration submission of a newInstance configured buildstep (builder) inside the Flexible Publish publisher.
Maybe I've missed something, and you can help me undestand, but like I said, I did not find a single build step that configured correctly when using newInstance.
Code changed in jenkins
User: Nicolas De Loof
Path:
src/main/java/org/jenkinsci/plugins/conditionalbuildstep/lister/DefaultBuilderDescriptorLister.java
http://jenkins-ci.org/commit/conditional-buildstep-plugin/fcfc219e627afaa8b19395674a756fe4dda43e7d
Log:
[FIXED JENKINS-15445] use Functions#getBuilderDescriptors to select the matching descriptors
don't check for @DataBoundConstructor. Descriptor may not use it to create instances