Skip to content

[JENKINS-46082] Culprits no longer available through json api #22236

Closed

Description

@jenkins-infra-bot

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 
    http://localhost:8080/jenkins/job/mytest/3/
  2. Check the json build result
    http://localhost:8080/jenkins/job/mytest/3/api/json
  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. 

 

 


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:

  1. Go to a failed build  http://localhost:8080/jenkins/job/mytest/3/
  2. Check the json build result http://localhost:8080/jenkins/job/mytest/3/api/json
  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. 

 

 

3 attachments

Activity

  1. jenkins-infra-bot commented on Aug 9, 2017

    @jenkins-infra-bot
    Author
  2. jenkins-infra-bot commented on Aug 10, 2017

    @jenkins-infra-bot
    Author
    oleg_nenashev:

    Passing it to abayer, who is an author of 3913680

  3. jenkins-infra-bot commented on Aug 10, 2017

    @jenkins-infra-bot
    Author
    abayer:
    • Original comment link
    • Raw content of original comment:

      woo. Will investigate.

    woo. Will investigate.

  4. jenkins-infra-bot commented on Aug 11, 2017

    @jenkins-infra-bot
    Author
    abayer:
    • Original comment link
    • 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.

    So Stapler does take the Exported annotation from superclasses, but apparently not from default methods in interfaces. That's lame.

  5. jenkins-infra-bot commented on Aug 11, 2017

    @jenkins-infra-bot
    Author
    aurelianteglas:
    • Original comment link
    • Raw content of original comment:

      I guess that's new feature, it did not need to, until recently .

    I guess that's new feature, it did not need to, until recently .

  6. jenkins-infra-bot commented on Aug 11, 2017

    @jenkins-infra-bot
    Author
    abayer:
    • Original comment link
    • Raw content of original comment:

      Core PR up, will have a workflow-job PR up momentarily.

    Core PR up, will have a workflow-job PR up momentarily.

  7. jenkins-infra-bot commented on Aug 11, 2017

    @jenkins-infra-bot
    Author
    abayer:
    • Original comment link
    • Raw content of original comment:

      And workflow-job PR is up too.

    And workflow-job PR is up too.

  8. jenkins-infra-bot commented on Aug 12, 2017

    @jenkins-infra-bot
    Author
    scm_issue_link:

    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.

  9. jenkins-infra-bot commented on Aug 14, 2017

    @jenkins-infra-bot
    Author
    oleg_nenashev:
    • Original comment link
    • 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

    The fix has been integrated towards Jenkins 2.74. Marking as LTS Candidate since it is a regression in 2.60

  10. jenkins-infra-bot commented on Sep 4, 2017

    @jenkins-infra-bot
    Author
    scm_issue_link:

    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)

  11. jenkins-infra-bot commented on Sep 11, 2017

    @jenkins-infra-bot
    Author
    scm_issue_link:

    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.

  12. jenkins-infra-bot commented on Nov 24, 2025

    @jenkins-infra-bot
    Author

    [Original relates_to from Jira: JENKINS-46153]

  13. removed
    bugFor changelog: Minor bug. Will be listed after features
    on Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions