So
https://github.com/jenkinsci/workflow-plugin/blob/30a80b44ef524333165ed59b25de30daf1b2a99d/cps/src/main/java/org/jenkinsci/plugins/workflow/cps/DSL.java#L116 - right now, the parallel step is the only step that can act as a container for further steps without having those further steps directly specified as a closure argument to the step. How would we go about generalizing this?
I ask because for what I'm working on currently, I want to be able to take a declarative data structure in closure form as an argument and then construct and execute Pipeline from that. I'm writing this as a Step, so I believe I need to be put in the right bucket in the section I linked to above, and if my Step doesn't have a body and isn't ParallelStep, it gets put in the atomic node bucket. That's not where it needs to end up, I don't think.
So I've got two thoughts on how to work around this and I'm not sure if either of them is at all wise and/or sane, hence emailing for advice:
- Scenario 1: Change ParallelStep (and its DescriptorImpl accordingly) to extend a new abstract Step that we then use for the check I linked to above. Then my Step can do the same thing and tada! Theoretically.
Advice? Thoughts? Halp? =)
A.