Repository navigation
[JENKINS-46082] Culprits no longer available through json api #22236
Description
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:
- Go to a failed build
http://localhost:8080/jenkins/job/mytest/3/ - Check the json build result
http://localhost:8080/jenkins/job/mytest/3/api/json - 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?
- 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.
- Expose the method back in AbstractBuild, even if just delegates to the RunWithSCM one, like in the attached patch.
- 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.
Originally reported by
aurelianteglas, imported from: Culprits no longer available through json api
- assignee:
abayer
- status: Resolved
- priority: Minor
- component(s): core
- label(s): 2.73.1-fixed, regression, stapler
- resolution: Fixed
- resolved: 2017-08-14T10:32:26+00:00
- votes: 0
- watchers: 4
- imported: 2025-11-24
Raw content of original issue
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:
- Go to a failed build http://localhost:8080/jenkins/job/mytest/3/
- Check the json build result http://localhost:8080/jenkins/job/mytest/3/api/json
- 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?
- 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.
- Expose the method back in AbstractBuild, even if just delegates to the RunWithSCM one, like in the attached patch.
- 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.


Activity
jenkins-infra-bot commentedon Aug 9, 2017
Remote links associated with this issue:
jenkins-infra-bot commentedon Aug 10, 2017
Raw content of original comment:
Passing it to abayer, who is an author of 3913680
jenkins-infra-bot commentedon Aug 10, 2017
Raw content of original comment:
woo. Will investigate.
jenkins-infra-bot commentedon Aug 11, 2017
Raw content of original comment:
So Stapler does take the Exported annotation from superclasses, but apparently not from default methods in interfaces. That's lame.
jenkins-infra-bot commentedon Aug 11, 2017
Raw content of original comment:
I guess that's new feature, it did not need to, until recently
.
jenkins-infra-bot commentedon Aug 11, 2017
Raw content of original comment:
Core PR up, will have a workflow-job PR up momentarily.
jenkins-infra-bot commentedon Aug 11, 2017
Raw content of original comment:
And workflow-job PR is up too.
jenkins-infra-bot commentedon Aug 12, 2017
Raw content of original comment:
Code changed in jenkins
User: Andrew Bayer
Path:
core/src/main/java/hudson/model/AbstractBuild.java
test/src/test/java/hudson/model/AbstractBuildTest.java
http://jenkins-ci.org/commit/jenkins/a975f7227ee58d3f274b82e3d9b615b297f30fa0
Log:
[FIXED JENKINS-46082] API will include culprits again.
jenkins-infra-bot commentedon Aug 14, 2017
Raw content of original comment:
The fix has been integrated towards Jenkins 2.74. Marking as LTS Candidate since it is a regression in 2.60
jenkins-infra-bot commentedon Sep 4, 2017
Raw content of original comment:
Code changed in jenkins
User: Andrew Bayer
Path:
core/src/main/java/hudson/model/AbstractBuild.java
test/src/test/java/hudson/model/AbstractBuildTest.java
http://jenkins-ci.org/commit/jenkins/69d8fe47ff9d60cd885aaeb3e0b91b4fcfe6ba6e
Log:
[FIXED JENKINS-46082] API will include culprits again.
(cherry picked from commit a975f72)
jenkins-infra-bot commentedon Sep 11, 2017
Raw content of original comment:
Code changed in jenkins
User: Andrew Bayer
Path:
src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
src/test/java/org/jenkinsci/plugins/workflow/job/WorkflowRunTest.java
http://jenkins-ci.org/commit/workflow-job-plugin/51a981e65f6d9d51609ffc74e9f15bdf616a4890
Log:
[FIXED JENKINS-46082] API will now include culprits.
jenkins-infra-bot commentedon Nov 24, 2025
[Original
relates_tofrom Jira: JENKINS-46153]