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

WorkflowJob.getSCMs() should have similar behaviour as poll()

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • workflow-job-plugin
    • None
    • jenkins: 2.19.4
      workflow-job: 2.9

      The implementation of WorkflowJob.getSCMs() is troublesome. It uses the latest completed build to determine the SCM resource. Normally this works fine, however, if the last completed build has failed before all SCM resources was checked out, then none or not all SCM resources are returned. This is quite common for us since we, from time to time, have network problems and the SCM checkout step fails.
      So, I therefor suggest that getSCMs() first check if getLastSuccessfulBuild() returns a build, if not fall back by using getLastCompletedBuild().
      This behaviour is also more inline with WorkflowJob.poll() where it first check for a successful build.

          [JENKINS-40255] WorkflowJob.getSCMs() should have similar behaviour as poll()

          Code changed in jenkins
          User: jon
          Path:
          src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java
          http://jenkins-ci.org/commit/workflow-job-plugin/0b04f3d9fb2c00768b0d97eadf2a44023c75c0e8
          Log:
          JENKINS-40255 Changed behavior for WorkflowJob.getSCMs(), not it checks for successful build first.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: jon Path: src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java http://jenkins-ci.org/commit/workflow-job-plugin/0b04f3d9fb2c00768b0d97eadf2a44023c75c0e8 Log: JENKINS-40255 Changed behavior for WorkflowJob.getSCMs(), not it checks for successful build first.

          Code changed in jenkins
          User: jon
          Path:
          src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java
          http://jenkins-ci.org/commit/workflow-job-plugin/ffdde4e96cb16985b08c511d0383b7c7c12b1793
          Log:
          JENKINS-40255 Changed behavior for WorkflowJob.getSCMs(), now it checks for successful build first.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: jon Path: src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java http://jenkins-ci.org/commit/workflow-job-plugin/ffdde4e96cb16985b08c511d0383b7c7c12b1793 Log: JENKINS-40255 Changed behavior for WorkflowJob.getSCMs(), now it checks for successful build first.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: jon Path: http://jenkins-ci.org/commit/workflow-job-plugin/9209eac4647fbbda2ea37993740ead9f7d7928aa Log: Merge branch ' JENKINS-40255 ' of https://github.com/jonsten/workflow-job-plugin into JENKINS-40255

          Code changed in jenkins
          User: jon
          Path:
          src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java
          http://jenkins-ci.org/commit/workflow-job-plugin/16b97e4ec4b03f9b3cb9793659d818ceec94eda7
          Log:
          JENKINS-40255 Changed behavior for WorkflowJob.getSCMs(), now it checks for successful build first.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: jon Path: src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java http://jenkins-ci.org/commit/workflow-job-plugin/16b97e4ec4b03f9b3cb9793659d818ceec94eda7 Log: JENKINS-40255 Changed behavior for WorkflowJob.getSCMs(), now it checks for successful build first.

          Code changed in jenkins
          User: jon
          Path:
          src/test/java/org/jenkinsci/plugins/workflow/job/WorkflowJobTest.java
          http://jenkins-ci.org/commit/workflow-job-plugin/52b0ace9d9e900014272abda168d0f432b94ea97
          Log:
          Added test case for JENKINS-40255

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: jon Path: src/test/java/org/jenkinsci/plugins/workflow/job/WorkflowJobTest.java http://jenkins-ci.org/commit/workflow-job-plugin/52b0ace9d9e900014272abda168d0f432b94ea97 Log: Added test case for JENKINS-40255

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: jon Path: http://jenkins-ci.org/commit/workflow-job-plugin/57854e31c65b9d143c0a5147d3d14431f9885340 Log: Merge branch ' JENKINS-40255 ' of https://github.com/jonsten/workflow-job-plugin into JENKINS-40255

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java
          src/test/java/org/jenkinsci/plugins/workflow/job/WorkflowJobTest.java
          http://jenkins-ci.org/commit/workflow-job-plugin/c21b9baf728f8ad0194986e83bc0a15879b65184
          Log:
          Merge pull request #34 from jonsten/JENKINS-40255

          JENKINS-40255 Changed getSCMs(), now it checks for successful builds first.

          Compare: https://github.com/jenkinsci/workflow-job-plugin/compare/c2bb083e4c21...c21b9baf728f

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java src/test/java/org/jenkinsci/plugins/workflow/job/WorkflowJobTest.java http://jenkins-ci.org/commit/workflow-job-plugin/c21b9baf728f8ad0194986e83bc0a15879b65184 Log: Merge pull request #34 from jonsten/ JENKINS-40255 JENKINS-40255 Changed getSCMs(), now it checks for successful builds first. Compare: https://github.com/jenkinsci/workflow-job-plugin/compare/c2bb083e4c21...c21b9baf728f

            jons Jon Sten
            jons Jon Sten
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: