jenkinsci / jenkinsci/matrix-project-plugin

[JENKINS-62773] Allow for nesting Parallel and Matrix blocks

Open
#720 1 comment 3 reactions 0 assignees View on GitHub
component:matrix-project-plugin component:pipeline-model-definition-plugin component:workflow-cps-plugin enhancement imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
17
Forks
85
Avg merge
4h 27m
Merged PRs (30d)
5

Description

Apologies if this is a duplicate, but I couldn't find another ticket.

I'd like to create a job that runs a standalone stage, and a matrix based stage, in parallel. Below is an example of what I'm thinking. The AWS job has different steps / params, so it would be run in parallel to the matrix build, which has several more variants.

When running the below, the build stops, and tells me `"matrix" or "parallel" cannot be nested inside another "matrix" or "parallel"`.

 

    stage('Build Images') {

parallel {
stage ('Build AWS') {
steps {
echo "Running AWS Clone Packer Job"
sh 'doing stuff'
}
}

stage('Build vCenter') {
matrix {
axes {
axis {
name 'DC'
values 'DC1', 'DC2'
}
axis {
name 'DB'
values 'DB1', 'DB2'
}
axis {
name 'TENNANTS'
values 'ST', 'MT'
}
}
}
steps {
echo "Running vCenter Clone Packer Job"
sh "doing something in a matrix"
}
}
}
}

---
Originally reported by herocc, imported from: Allow for nesting Parallel and Matrix blocks


  • status: Open
  • priority: Major
  • component(s): matrix-project-plugin, pipeline-model-definition-plugin, workflow-cps-plugin
  • resolution: Unresolved
  • votes: 17
  • watchers: 17
  • imported: 2025-12-06

Raw content of original issue

Apologies if this is a duplicate, but I couldn't find another ticket.

I'd like to create a job that runs a standalone stage, and a matrix based stage, in parallel. Below is an example of what I'm thinking. The AWS job has different steps / params, so it would be run in parallel to the matrix build, which has several more variants.

When running the below, the build stops, and tells me `"matrix" or "parallel" cannot be nested inside another "matrix" or "parallel"`.
 



    stage('Build Images') {

parallel {
stage ('Build AWS') {
steps {
echo "Running AWS Clone Packer Job"
sh 'doing stuff'
}
}

stage('Build vCenter') {
matrix {
axes {
axis {
name 'DC'
values 'DC1', 'DC2'
}
axis {
name 'DB'
values 'DB1', 'DB2'
}
axis {
name 'TENNANTS'
values 'ST', 'MT'
}
}
}
steps {
echo "Running vCenter Clone Packer Job"
sh "doing something in a matrix"
}
}
}
}


  • environment: CloudBees Core Managed Master 2.204.3.7

Contributor guide

Open the contributing guide

Research direction

Start by examining the matrix-project-plugin, pipeline-model-definition-plugin, and workflow-cps-plugin components and trace the validation that produces the nesting error. Use the provided Pipeline example as the behavioral target; done means compatible nested Parallel and Matrix blocks are accepted without that error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, ci-cd
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.