[JIRA] (JENKINS-61280) Allow dynamic stage names

12 views
Skip to first unread message

rittneje@gmail.com (JIRA)

unread,
Feb 29, 2020, 10:04:03 AM2/29/20
to jenkinsc...@googlegroups.com
Jesse Rittner created an issue
 
Jenkins / New Feature JENKINS-61280
Allow dynamic stage names
Issue Type: New Feature New Feature
Assignee: Andrew Bayer
Components: pipeline-model-definition-plugin
Created: 2020-02-29 15:03
Priority: Minor Minor
Reporter: Jesse Rittner

I would like the ability to have stage names be dynamic strings. This is useful, for instance, when defining stages within a matrix, so that the stage names can contain the values of the axes. (Part of the problem here is that Blue Ocean doesn't render matrixes well at all.) Right now attempting to do this yields an error because stage names can only be string literals, not Groovy strings (interpolation).

Note that I am not looking for the steps within the stage to be dynamic.

Example:

matrix {
    axes {
        axis {
            name 'PLATFORM'
            values 'linux', 'mac', 'windows'
        }
    }
    stages {
        stage("Build ${PLATFORM}") {
            // ...
        }
        stage("Test ${PLATFORM}") {
            // ...
        }
        stage("Deploy ${PLATFORM}") {
            // ...
        }
    }
}
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

bitwiseman@gmail.com (JIRA)

unread,
Mar 4, 2020, 12:14:03 PM3/4/20
to jenkinsc...@googlegroups.com
Liam Newman assigned an issue to Liam Newman
Change By: Liam Newman
Assignee: Andrew Bayer Liam Newman

bitwiseman@gmail.com (JIRA)

unread,
Mar 4, 2020, 12:21:03 PM3/4/20
to jenkinsc...@googlegroups.com
Liam Newman commented on New Feature JENKINS-61280
 
Re: Allow dynamic stage names

Stage names must be resolved before the pipeline starts.

Since matrix construction is also done before pipeline start, the exact scenario above could be supported.
However, users would then quite reasonably assume that they could put other variables into those interpolations and would get problems.

I do not know the reason stage names must be resolved before the pipeline starts, but figuring out how to change that more generally would require some digging.

stefan.drissen@gmail.com (JIRA)

unread,
Mar 19, 2020, 12:21:03 PM3/19/20
to jenkinsc...@googlegroups.com
Stefan Drissen updated an issue
Change By: Stefan Drissen
Attachment: image-2020-03-19-17-20-50-002.png

stefan.drissen@gmail.com (JIRA)

unread,
Mar 19, 2020, 12:21:03 PM3/19/20
to jenkinsc...@googlegroups.com
Stefan Drissen updated an issue
Change By: Stefan Drissen
Attachment: image-2020-03-19-17-20-23-015.png

stefan.drissen@gmail.com (JIRA)

unread,
Mar 19, 2020, 12:23:03 PM3/19/20
to jenkinsc...@googlegroups.com

I'm revisiting replacing a big xml template based multi-job project with a declarative matrix pipeline. While the matrix implementation was really nice and quick to setup, the visualization was a bit of let down. Dynamic stage names would really really really help.

Current state:

With stage names based on matrix values:

 

stefan.drissen@gmail.com (JIRA)

unread,
Mar 19, 2020, 12:23:03 PM3/19/20
to jenkinsc...@googlegroups.com
Stefan Drissen updated an issue
Change By: Stefan Drissen
Attachment: image-2020-03-19-17-22-05-861.png

stefan.drissen@gmail.com (JIRA)

unread,
Mar 19, 2020, 12:24:02 PM3/19/20
to jenkinsc...@googlegroups.com
Stefan Drissen updated an issue
Change By: Stefan Drissen
Attachment: image-2020-03-19-17-20-50-002.png
Reply all
Reply to author
Forward
0 new messages