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

Option to interrupt remaining branches when one branch fails

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: pipeline
    • Labels:
      None
    • Environment:
      workflow plugin 1.1
    • Similar Issues:

      Description

      As recorded in https://groups.google.com/d/msg/jenkinsci-dev/kgEc7vZQgi0/IC1rH_6KwNYJ:

      Our deploy process currently builds deploy artifacts and runs tests at the same time. I see how we could implement that using workflow via the 'parallel' step. However, we also want the behavior that if and when build-artifacts fails, it immediately cancels the running tests and fails the deploy job; and likewise if the tests fail, it immediately cancels the building of artifacts and fails the deploy job. If both succeed, then the deploy job continues.

      This is a feature request to implement this sibling-cancel: with a flag (or perhaps as the default, though that's kinda scary), if one of the jobs in parallel() fails, then parallel cancels the other jobs.

      It sounds like parallel returns a map from job-label to job-status. I think under this behavior, the job-status would be "failed" for the job that failed, and "cancelled" for the sibling jobs that were cancelled.

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: James Nord
            Path:
            aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/parallel/ParallelStepTest.java
            cps/src/main/java/org/jenkinsci/plugins/workflow/cps/steps/ParallelStep.java
            cps/src/main/java/org/jenkinsci/plugins/workflow/cps/steps/ParallelStepExecution.java
            cps/src/main/resources/org/jenkinsci/plugins/workflow/cps/steps/ParallelStep/config.jelly
            http://jenkins-ci.org/commit/workflow-plugin/76f64222588c215e6577972971aada9bf871d811
            Log:
            JENKINS-26034 add option to fail fast on parallel branch failure.

            Added an option "failFast: true" to the parallel step options that
            will terminate all running branches inside a parallel step if one of the
            branches fails.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: James Nord Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/parallel/ParallelStepTest.java cps/src/main/java/org/jenkinsci/plugins/workflow/cps/steps/ParallelStep.java cps/src/main/java/org/jenkinsci/plugins/workflow/cps/steps/ParallelStepExecution.java cps/src/main/resources/org/jenkinsci/plugins/workflow/cps/steps/ParallelStep/config.jelly http://jenkins-ci.org/commit/workflow-plugin/76f64222588c215e6577972971aada9bf871d811 Log: JENKINS-26034 add option to fail fast on parallel branch failure. Added an option "failFast: true" to the parallel step options that will terminate all running branches inside a parallel step if one of the branches fails.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            CHANGES.md
            aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/parallel/ParallelStepTest.java
            cps/src/main/java/org/jenkinsci/plugins/workflow/cps/steps/ParallelStep.java
            cps/src/main/java/org/jenkinsci/plugins/workflow/cps/steps/ParallelStepExecution.java
            cps/src/main/resources/org/jenkinsci/plugins/workflow/cps/steps/ParallelStep/config.jelly
            http://jenkins-ci.org/commit/workflow-plugin/841d231280bb2470352f4b472bdf89c328cda304
            Log:
            Merge pull request #88 from jtnord/failFast

            JENKINS-26034 add option to fail fast on parallel branch failure.

            Compare: https://github.com/jenkinsci/workflow-plugin/compare/f2b787c9d2a8...841d231280bb

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: CHANGES.md aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/parallel/ParallelStepTest.java cps/src/main/java/org/jenkinsci/plugins/workflow/cps/steps/ParallelStep.java cps/src/main/java/org/jenkinsci/plugins/workflow/cps/steps/ParallelStepExecution.java cps/src/main/resources/org/jenkinsci/plugins/workflow/cps/steps/ParallelStep/config.jelly http://jenkins-ci.org/commit/workflow-plugin/841d231280bb2470352f4b472bdf89c328cda304 Log: Merge pull request #88 from jtnord/failFast JENKINS-26034 add option to fail fast on parallel branch failure. Compare: https://github.com/jenkinsci/workflow-plugin/compare/f2b787c9d2a8...841d231280bb
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: James Nord
            Path:
            aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/parallel/ParallelStepTest.java
            cps/src/main/java/org/jenkinsci/plugins/workflow/cps/steps/ParallelStep.java
            cps/src/main/java/org/jenkinsci/plugins/workflow/cps/steps/ParallelStepExecution.java
            cps/src/main/resources/org/jenkinsci/plugins/workflow/cps/steps/ParallelStep/config.jelly
            http://jenkins-ci.org/commit/workflow-cps-plugin/c8c668f2b60a19c33add92e2b14345f23f58aabc
            Log:
            JENKINS-26034 add option to fail fast on parallel branch failure.

            Added an option "failFast: true" to the parallel step options that
            will terminate all running branches inside a parallel step if one of the
            branches fails.

            Originally-Committed-As: 76f64222588c215e6577972971aada9bf871d811

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: James Nord Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/parallel/ParallelStepTest.java cps/src/main/java/org/jenkinsci/plugins/workflow/cps/steps/ParallelStep.java cps/src/main/java/org/jenkinsci/plugins/workflow/cps/steps/ParallelStepExecution.java cps/src/main/resources/org/jenkinsci/plugins/workflow/cps/steps/ParallelStep/config.jelly http://jenkins-ci.org/commit/workflow-cps-plugin/c8c668f2b60a19c33add92e2b14345f23f58aabc Log: JENKINS-26034 add option to fail fast on parallel branch failure. Added an option "failFast: true" to the parallel step options that will terminate all running branches inside a parallel step if one of the branches fails. Originally-Committed-As: 76f64222588c215e6577972971aada9bf871d811
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/parallel/ParallelStepTest.java
            cps/src/main/java/org/jenkinsci/plugins/workflow/cps/steps/ParallelStep.java
            cps/src/main/java/org/jenkinsci/plugins/workflow/cps/steps/ParallelStepExecution.java
            cps/src/main/resources/org/jenkinsci/plugins/workflow/cps/steps/ParallelStep/config.jelly
            http://jenkins-ci.org/commit/workflow-cps-plugin/246c2d2a0f97436ea880637ac33cc8bdcbb3e298
            Log:
            Merge pull request #88 from jtnord/failFast

            JENKINS-26034 add option to fail fast on parallel branch failure.
            Originally-Committed-As: 841d231280bb2470352f4b472bdf89c328cda304

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/parallel/ParallelStepTest.java cps/src/main/java/org/jenkinsci/plugins/workflow/cps/steps/ParallelStep.java cps/src/main/java/org/jenkinsci/plugins/workflow/cps/steps/ParallelStepExecution.java cps/src/main/resources/org/jenkinsci/plugins/workflow/cps/steps/ParallelStep/config.jelly http://jenkins-ci.org/commit/workflow-cps-plugin/246c2d2a0f97436ea880637ac33cc8bdcbb3e298 Log: Merge pull request #88 from jtnord/failFast JENKINS-26034 add option to fail fast on parallel branch failure. Originally-Committed-As: 841d231280bb2470352f4b472bdf89c328cda304
            Hide
            csilvers Craig Silverstein added a comment -

            We have `failFast` now!

            Show
            csilvers Craig Silverstein added a comment - We have `failFast` now!

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              csilvers Craig Silverstein
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: