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

failFast option for parallel stages should be able to set build result to FAILED

    • pipeline-model-definition 1.3.5

      If a user has a Declarative Pipeline script with parallel stages, and they set 'failFast true' for those stages, if one of the stages fails then the build is immediately aborted. The result of the build is set to ABORTED. It would be better if there was a way to optionally have the build result be FAILURE in this case (in a scripted pipeline the result will be FAILURE). Although it makes a kind of logical sense for it to be ABORTED, because we have told Jenkins to abort the build, we did so because a stage failed. If we didn't failFast, the build's result would always be FAILURE.

      Here is an example Declarative Pipeline that demonstrates the problem:

      pipeline {
          agent any
          stages {
              stage('Parallel Stage') {
                  failFast true
                  parallel {
                      stage('Branch A') {
                          steps {
                              sh 'false'
                          }
                      }
                      stage('Branch B') {
                          steps {
                              sleep 10
                              echo "On Branch B"
                          }
                      }
                  }
              }
          }
      }
      

          [JENKINS-55459] failFast option for parallel stages should be able to set build result to FAILED

          Owen Mehegan created issue -
          Andrew Bayer made changes -
          Component/s New: workflow-cps-plugin [ 21713 ]
          Component/s Original: pipeline-model-definition-plugin [ 21706 ]
          Andrew Bayer made changes -
          Assignee Original: Andrew Bayer [ abayer ]
          Devin Nusbaum made changes -
          Component/s New: pipeline-model-definition-plugin [ 21706 ]
          Component/s Original: workflow-cps-plugin [ 21713 ]
          Devin Nusbaum made changes -
          Description Original: If a user has a Pipeline script with parallel stages, and they set 'failFast true' for those stages, if one of the stages fails then the build is immediately aborted. The result of the build is set to ABORTED. It would be better if there was a way to optionally have the build result be FAILED in this case. Although it makes a kind of logical sense for it to be ABORTED, because we have told Jenkins to abort the build, we did so because a stage failed. If we didn't failFast, the build's result would always be FAILED.  New: If a user has a Declarative Pipeline script with parallel stages, and they set 'failFast true' for those stages, if one of the stages fails then the build is immediately aborted. The result of the build is set to ABORTED. It would be better if there was a way to optionally have the build result be FAILURE in this case (in a scripted pipeline the result will be FAILURE). Although it makes a kind of logical sense for it to be ABORTED, because we have told Jenkins to abort the build, we did so because a stage failed. If we didn't failFast, the build's result would always be FAILURE.

          Here is an example Declarative Pipeline that demonstrates the problem:

          {noformat}
          pipeline {
              agent any
              stages {
                  stage('Parallel Stage') {
                      failFast true
                      parallel {
                          stage('Branch A') {
                              steps {
                                  sh 'false'
                              }
                          }
                          stage('Branch B') {
                              steps {
                                  sleep 10
                                  echo "On Branch B"
                              }
                          }
                      }
                  }
              }
          }
          {noformat}
          Devin Nusbaum made changes -
          Remote Link New: This issue links to "jenkinsci/pipeline-model-definition-plugin#313 (Web Link)" [ 22414 ]
          Devin Nusbaum made changes -
          Assignee New: Devin Nusbaum [ dnusbaum ]
          Devin Nusbaum made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Devin Nusbaum made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Devin Nusbaum made changes -
          Status Original: In Review [ 10005 ] New: In Progress [ 3 ]
          Devin Nusbaum made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Fixed but Unreleased [ 10203 ]

            dnusbaum Devin Nusbaum
            owenmehegan Owen Mehegan
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: