Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-10487

Remote API call to get list of enabled plugins for a job

      For NetBeans task list integration I am making use of https://wiki.jenkins-ci.org/display/JENKINS/Static+Code+Analysis+Plug-ins#StaticCodeAnalysisPlug-ins-RemoteAPI which works but has the performance issue that since the IDE does not know in advance which (if any) analysis plugins are actually in use for a given job, it has to go through a list of known plugin IDs and access the remote API for each one, skipping over ones that give a 404.

      It would be nicer if e.g. $build/analysisPlugins/api/xml were bound to something that simply enumerated the plugin IDs. (Alternately, this API object could directly list all the results under e.g. <findbugsResult>.)

          [JENKINS-10487] Remote API call to get list of enabled plugins for a job

          Ulli Hafner added a comment -

          It would be nicer if e.g. $build/analysisPlugins/api/xml were bound to something that simply enumerated the plugin IDs. (Alternately, this API object could directly list all the results under e.g. <findbugsResult>.)

          I think the latter one is already available when using the analysis-collector plug-in that shows the aggregation of all plug-ins:
          http://www.faktorzehn.org:8081/view/Jenkins/job/Jenkins%20Analysis%20Plug-ins/300/analysisResult/api/xml
          Or do you need the individual results?

          Ulli Hafner added a comment - It would be nicer if e.g. $build/analysisPlugins/api/xml were bound to something that simply enumerated the plugin IDs. (Alternately, this API object could directly list all the results under e.g. <findbugsResult>.) I think the latter one is already available when using the analysis-collector plug-in that shows the aggregation of all plug-ins: http://www.faktorzehn.org:8081/view/Jenkins/job/Jenkins%20Analysis%20Plug-ins/300/analysisResult/api/xml Or do you need the individual results?

          Jesse Glick added a comment -

          That might work when that plugin is installed, but for e.g. https://builds.apache.org/job/Ant_Nightly/lastSuccessfulBuild/ there is no such API object. Would prefer something built in to the Analysis Core module so it is always available.

          Jesse Glick added a comment - That might work when that plugin is installed, but for e.g. https://builds.apache.org/job/Ant_Nightly/lastSuccessfulBuild/ there is no such API object. Would prefer something built in to the Analysis Core module so it is always available.

          Ulli Hafner added a comment -

          Ok, I see. Currently the analysis-core plug-in does not know which plug-ins are actually running (that was the reason for the collector plugin).

          Ulli Hafner added a comment - Ok, I see. Currently the analysis-core plug-in does not know which plug-ins are actually running (that was the reason for the collector plugin).

          Jesse Glick added a comment -

          Ah. It seems that it should be possible to find what Action objects (right?) are being exposed by the job, but if not then I guess this has to be closed and I just request sites to run the collector plugin.

          Jesse Glick added a comment - Ah. It seems that it should be possible to find what Action objects (right?) are being exposed by the job, but if not then I guess this has to be closed and I just request sites to run the collector plugin.

          Ulli Hafner added a comment -

          I can check which action objects are available and test for all results if they are deriving from a base class of analysis-core. That should work.

          However, the longer I am thinking about it: maybe I should move all the code of the analysis collector plug-in code to analysis core and provide an extension point that the individual plug-ins implement. Then core needs not to know anything about the individual plug-ins but still can present an aggregation...

          Ulli Hafner added a comment - I can check which action objects are available and test for all results if they are deriving from a base class of analysis-core. That should work. However, the longer I am thinking about it: maybe I should move all the code of the analysis collector plug-in code to analysis core and provide an extension point that the individual plug-ins implement. Then core needs not to know anything about the individual plug-ins but still can present an aggregation...

          Jesse Glick added a comment -

          Right, an extension point is how I would have expected it to work already.

          Behavioral compatibility might be tricky, i.e. in case one of the plugins is updated but not core, or vice-versa.

          Jesse Glick added a comment - Right, an extension point is how I would have expected it to work already. Behavioral compatibility might be tricky, i.e. in case one of the plugins is updated but not core, or vice-versa.

          Ulli Hafner added a comment - - edited

          Will be part of warnings Next Generation Plugin 1.0.

          See documentation.

          Ulli Hafner added a comment - - edited Will be part of warnings Next Generation Plugin 1.0. See documentation .

            drulli Ulli Hafner
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: