Thinking about syntax here - some possibilities:
First, I think this feels generally right for defining a "group" of stages to run sequentially:
group('some-name') {
stage('a') { ... }
stage('b') { ... }
}
I'm open to something other than "group". The main thing is to have a name for the group - this ends up, behind the scenes, being the name of the parallel step branch the group's stages get executed within. I decided to go with group('some-name') rather than a nested name 'some-name' field because if we did the latter, we'd either have to add another nested stages or something like that for the individual stage definitions to be in, or we'd have the contents of group being either name ... or stage(...). I don't like mixing key/value pair fields in the same block as arbitrary-lists-of-things, so the latter doesn't work for me, and the former adds more verbosity than I think is really needed.
Second is how we handle declaring parallel groups in a stage, and related, how we handle existing parallel stages. I've played around with having parallel be able to contain either a list of stage or a list of group - or even a mix. Neither approach (exclusively stage or group, or non-exclusive) feels very smooth in implementation, though the syntax is pretty nice, especially for the mixed approach. I've also considered a new section, let's call it parallelGroups for now, where you could either have parallel or parallelGroups on a stage but not both. Much easier implementation-wise, better backwards compatibility (most notably for the editor, which wouldn't have to change how it handles parallel at all, just add parallelGroups support and make sure only one of the two can be used), worse syntax.
So here are the options as I see it:
Exclusive lists in parallel
stage('just-stages') {
parallel {
stage('a') { ... }
stage('b') { ... }
...
}
}
stage('just-groups') {
parallel {
group('first-group') {
stage('a) { ... }
}
group('second-group') {
stage('b') { ... }
stage('c') { ... }
}
}
Mixed lists in parallel
stage('mixed-list') {
parallel {
stage('a') { ... }
group('b-and-c') {
stage('b') { ... }
stage('c') { ... }
}
}
}
parallel and parallelGroups
stage('parallel-single-stages') {
parallel {
stage('a') { ... }
stage('b') { ... }
}
}
stage('parallelGroups') {
parallelGroups {
group('first-group') {
stage('a') { ... }
}
group('second-group') {
stage('b') { ... }
stage('c') { ... }
}
}
}
Thoughts? (ping kshultz michaelneale rsandell jamesdumay stephendonner rpocase hrmpw)
So this is on the longer-term roadmap. I'm not sure yet what the syntax will look like, but the necessary tooling in Blue Ocean to support this sort of visualization is beginning to come together. So hopefully we'll be able to get this in a few months.