-
Bug
-
Resolution: Unresolved
-
Major
-
None
My use-case for the plugin-usage-plugin is to determine which plugins can be removed without impacting jobs. As part of this, I often use it to track down which jobs must be modified before safely removing a plugin.
Job properties, such as from rebuild or throttle-concurrents, are always reported as used. I think this is because they save config in every job, whether that config is enabled or not. This is misleading, because a disabled feature can be safely removed without impacting a job.
Here is a partial example from a FreeStyleProject's config.xml:
<project> <properties> <hudson.plugins.throttleconcurrents.ThrottleJobProperty plugin="throttle-concurrents@2.0.1"> <categories class="java.util.concurrent.CopyOnWriteArrayList"/> <throttleEnabled>false</throttleEnabled> <throttleOption>project</throttleOption> <limitOneJobWithMatchingParams>false</limitOneJobWithMatchingParams> <paramsToUseForLimit/> <configVersion>1</configVersion> </hudson.plugins.throttleconcurrents.ThrottleJobProperty> </properties> </project>
I would only expect this to report as used if <throttleEnabled>true</throttleEnabled> were present.
There is no common enabled property in JobProperty.
Any code to support this would have to be custom to each implementation of JobProperty. This pages lists more than 140 implementations: https://www.jenkins.io/doc/developer/extensions/jenkins-core/#jobproperty.
If you want to check a specific plugin I would recommend a groovy script tailored for that plugin.