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

Culprits no longer available through json api


      Since build 2.60, the culprits are no longer available through the json api. They are probably not available through xml api either, the root cause seems to be the same. Steps to reproduce:

      1. Go to a failed build 
      2. Check the json build result
      3. Expect the json output to contain a culprits node but it no longer does 

      In changeset 39136804e53bf9f34cc91fdf3c64ab57d976eac3, method getCulprits was removed from AbstractBuild, as it already existed in the RunWithSCM interface as a default method. However, the model builder in stapler seems to only take @Exported methods from the current declaring class, and not from subclasses, so the data is no longer exported. 

      So, what are the solutions?

      1. Leave things as they are now. I think there are already a few tools on the internet that use this information. We have a dashing.io board that shows the status of various jenkins builds and this is currently broken.
      2. Expose the method back in AbstractBuild, even if just delegates to the RunWithSCM one, like in the attached patch. 
      3. Change the model behaviour in stapler to also consider exported methods from other classes in the hierarchy. I find this the most unlikely, could put out a lot of data. I doubt many use filtering on just what they need, so we would risk flooding them. 



            abayer Andrew Bayer
            aurelianteglas Aurelian Teglas
            0 Vote for this issue
            4 Start watching this issue