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

Scoring by Build Results always resulting in zero score

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • CentOS 7, Java 11, Jenkins 2.375.3

      1) Installed and Enabled the "Scoring Load Balancer" plugin

      2) Added "Scoring by Build Results", using all default settings

      3) Enabled logging for the plugin

      4) Scores are always zero, thus the previous build results are not affecting the score

       

      Both "Scoring by Node Loads" and "Scoring by Node Preferences" appear to be working correctly.

          [JENKINS-70726] Scoring by Build Results always resulting in zero score

          Are you able to update your Jenkins to at least v2.426.3? Then you can try the new plugin version, which was released yesterday.

          Michael Kriese added a comment - Are you able to update your Jenkins to at least v2.426.3? Then you can try the new plugin version, which was released yesterday.

          Brett Alex added a comment -

          still an issue with jenkins v2.452.3 and plugin version 111. 

          Brett Alex added a comment - still an issue with jenkins v2.452.3 and plugin version 111. 

          Brett Alex added a comment -

          ok, i've never looked at a jenkins plugin really this deep. Took a blessing from god to get it to build on redhat 9 because i guess the tools are just so old)

          anyway, finally got it to build and seems the issue is the Build Results scoring is skipped because the subtask is not derived from AbstractProject, it is a PlaceholderTask.  I can't understand how to go from a place holder task to a Build object to traverse the latest builds to update the scoring.

          Brett Alex added a comment - ok, i've never looked at a jenkins plugin really this deep. Took a blessing from god to get it to build on redhat 9 because i guess the tools are just so old) anyway, finally got it to build and seems the issue is the Build Results scoring is skipped because the subtask is not derived from AbstractProject, it is a PlaceholderTask.  I can't understand how to go from a place holder task to a Build object to traverse the latest builds to update the scoring.

          Brett Alex added a comment -

          i guess perhaps this plugin for build result scoring only works on freestyle jobs?  the whole workflow/pipeline api looks quite different. I have no idea how to get the build result or node name from the various WorkflowJob and WorkflowRun classes.  

          I was hoping to pull the node from getLastBuiltOn().getNodeName() but it's blank in my testing. Assume one has to better traverse the children to find the correct class but I can't find any documentation on the java/jenkins classes.

          These looked really promising, but couldn't figure it all out.

          https://stackoverflow.com/questions/78705046/how-to-get-hudson-model-node-from-org-jenkinsci-plugins-workflow-job-workflow

          https://community.jenkins.io/t/how-to-check-the-build-queue-for-an-existing-job-name/12554/4

           

          Brett Alex added a comment - i guess perhaps this plugin for build result scoring only works on freestyle jobs?  the whole workflow/pipeline api looks quite different. I have no idea how to get the build result or node name from the various WorkflowJob and WorkflowRun classes.   I was hoping to pull the node from getLastBuiltOn().getNodeName() but it's blank in my testing. Assume one has to better traverse the children to find the correct class but I can't find any documentation on the java/jenkins classes. These looked really promising, but couldn't figure it all out. https://stackoverflow.com/questions/78705046/how-to-get-hudson-model-node-from-org-jenkinsci-plugins-workflow-job-workflow https://community.jenkins.io/t/how-to-check-the-build-queue-for-an-existing-job-name/12554/4  

          Brett Alex added a comment - - edited

          Finally figured it out, created a PR https://github.com/jenkinsci/scoring-load-balancer-plugin/pull/65 that works at least for me to enable Build Result scoring on pipeline jobs.

          Brett Alex added a comment - - edited Finally figured it out, created a PR https://github.com/jenkinsci/scoring-load-balancer-plugin/pull/65 that works at least for me to enable Build Result scoring on pipeline jobs.

            Unassigned Unassigned
            aoindustries AO Industries, Inc.
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: