[JIRA] (JENKINS-56586) Parallel stages or branches can only be included in a top-level stage

1 view
Skip to first unread message

brian.murrell@intel.com (JIRA)

unread,
Mar 15, 2019, 11:03:03 AM3/15/19
to jenkinsc...@googlegroups.com
Brian J Murrell created an issue
 
Jenkins / Improvement JENKINS-56586
Parallel stages or branches can only be included in a top-level stage
Issue Type: Improvement Improvement
Assignee: Unassigned
Components: pipeline, workflow-basic-steps-plugin
Created: 2019-03-15 15:02
Priority: Critical Critical
Reporter: Brian J Murrell

When I try to use nested parallel statements in a declarative pipeline as such:

 pipeline {
    agent none
    stages {
        stage('Cancel Previous Builds') { steps { echo "Cancel Previous Builds" } }
        stage('Pre-build') { steps { echo "Pre-build" } }
        stage("Build and Test") {
            parallel {
                stage('Build and Test') {
                    stages {
                        stage('Build Platform 1') { steps { echo "Build Platform 1" } }
                        stage('Test Platform 1') { 
                            parallel {
                                stage('Test 1') { steps { echo "Test 1" } }
                                stage('Test 2') { steps { echo "Test 2" } }
                                stage('Test 3') { steps { echo "Test 3" } }
                            }
                        }
                    }
                }
                stage('Build Platform 2') { steps { echo "Build Platform 2" } }
                stage('Build Platform 3') { steps { echo "Build Platform 3" } }
            }
        }
    }
}

I get an error:

WorkflowScript: 25: Parallel stages or branches can only be included in a top-level stage. @ line 25, column 33.
                                   stage('Test 1') { steps { echo "Test 1" } }
                                   ^
 

A single level of parallel steps is really quite limiting.  I don't think my desired workflow is really all that much "out there".

From researching this I seem to find a lot of questions about multiple levels of parallel steps but not many answers.

Is this something that will be supported with declarative at some point?

To be clear, I don't care about Blue Ocean rendering and visualisation of such nested parallel stages, certainly never any time before JENKINS-39203 since that bug makes Blue Ocean visualisation pretty useless (IMHO) anyway.

But Blue Ocean aside, it would still be nice to have pipelines that could execute multiple levels of parallel stages.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

john.scaglione@gmail.com (JIRA)

unread,
Apr 5, 2019, 2:29:02 PM4/5/19
to jenkinsc...@googlegroups.com
John Scaglione commented on Improvement JENKINS-56586
 
Re: Parallel stages or branches can only be included in a top-level stage

This issue is affecting me too.  Even when using the example pipeline from the documentation, jenkins throws an error.

 

https://jenkins.io/doc/book/pipeline/syntax/#sequential-stages

ddj116@gmail.com (JIRA)

unread,
Apr 29, 2019, 4:00:02 PM4/29/19
to jenkinsc...@googlegroups.com

Same issue, as soon as I attempt parallel stages at a lower level I get the error:

WorkflowScript: 25: Parallel stages or branches can only be included in a top-level stage

gegles@gmail.com (JIRA)

unread,
Sep 23, 2019, 1:13:03 AM9/23/19
to jenkinsc...@googlegroups.com

Any progress on this? This is a real problem for us. 

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages