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

Culprits no longer available through json api

    XMLWordPrintable

    Details

    • Similar Issues:

      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:

      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. 

       

       

        Attachments

          Issue Links

            Activity

            Hide
            abayer Andrew Bayer added a comment -

            And workflow-job PR is up too.

            Show
            abayer Andrew Bayer added a comment - And workflow-job PR is up too.
            Hide
            scm_issue_link SCM/JIRA link daemon added a 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.

            Show
            scm_issue_link SCM/JIRA link daemon added a 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.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

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

            Show
            oleg_nenashev Oleg Nenashev added a comment - The fix has been integrated towards Jenkins 2.74. Marking as LTS Candidate since it is a regression in 2.60
            Hide
            scm_issue_link SCM/JIRA link daemon added a 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 a975f7227ee58d3f274b82e3d9b615b297f30fa0)

            Show
            scm_issue_link SCM/JIRA link daemon added a 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 a975f7227ee58d3f274b82e3d9b615b297f30fa0)
            Hide
            scm_issue_link SCM/JIRA link daemon added a 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.

            Show
            scm_issue_link SCM/JIRA link daemon added a 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.

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                aurelianteglas Aurelian Teglas
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: