i-m-c / jenkins-inheritance-plugin

GNU Lesser General Public License v3.0
26 stars 34 forks source link

The plugin doesn't play well with the inheritance plugin #6

Open FWFabio opened 10 years ago

FWFabio commented 10 years ago

When using a project built with a new template format introduced by this plugin: https://wiki.jenkins-ci.org/display/JENKINS/inheritance-plugin the build step "clang static analyser" doesn't come up on the list. Not sure what's wrong?

FWFabio commented 10 years ago

Posted to the wrong project :@ Anyway.. Clang Scan-build plugin doesn't work on inheriting projects. The action just doesn't appear.

HedAurabesh commented 10 years ago

Thanks for the bug report, Fabio.

We will be looking into this as soon as possible. Given the large amount of plug-ins out there, it is of course difficult to ensure compatibility with all of them.

For example, plug-ins can specify which types of projects they are compatible with. Some -- like the Artifactory Plug-in -- are so strict that they only work with Free-Style-Builds. In that case, the issue does not exactly lie with our Plug-in and might thus be hard to fix from our side.

But we'll see what we can do. :)

FWFabio commented 10 years ago

Thanks for your quick reply! Is there a quick way to check if the plugin has some restriction? I tried to browse the source code but I couldn't find anything.

HedAurabesh commented 10 years ago

Hi Fabio.

It depends on what the plugin contributes. For example, if it is a JobProperty, a BuildStep or a Publisher (which I deem most likely), the class has either a member method "isApplicable(AbstractProject<?, ?> item)" or is restricted via a Generic on the class definition.

In the Artifactory plugin for example, both ways are present, where some classes have the FreeStyleProject Generic and isApplicable() returns true if and only if the passed item is a FreeStyleProject.

If that is the case, Jenkins will not display the properties in the configuration screen, as the InheritanceProject class inherits from AbstractProject.

So the best approach is to either look for those methods, or try to find out if the "FreeStyleProject" class is directly used somewhere in the code. If so, then only the maintainer of the CLang plug-in can undo that, and reduce the restrictions down to "AbstractProject".