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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: workflow-job-plugin
    • Labels:
      None
    • Environment:
      jenkins: 2.19.4
      workflow-job: 2.9
    • Similar Issues:

      Description

      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.

        Attachments

          Issue Links

            Activity

            jons Jon Sten created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Link This issue relates to JENKINS-32214 [ JENKINS-32214 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "PR 34 (Web Link)" [ 15263 ]
            jglick Jesse Glick made changes -
            Assignee Jon Sten [ jons ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            jglick Jesse Glick made changes -
            Resolution Fixed [ 1 ]
            Status In Review [ 10005 ] Resolved [ 5 ]
            jglick Jesse Glick made changes -
            Link This issue is duplicated by JENKINS-41652 [ JENKINS-41652 ]

              People

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

                Dates

                Created:
                Updated:
                Resolved: