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.

- Scenario 2: Pass the closure argument to my Step as a body after all, but
rather than the normal approach of calling "newBodyInvoker()" in the
StepExecution start method (i.e., like
https://github.com/jenkinsci/workflow-plugin/blob/53e756588642a39d4e2c74590c317f0a904b26b1/basic-steps/src/main/java/org/jenkinsci/plugins/workflow/steps/RetryStepExecution.java#L18-L20),
instead process the "body" I got passed and generate a new closure to serve
as the actual body to execute, resulting in a call more like
https://github.com/jenkinsci/workflow-plugin/blob/18624a0af5492c51b47291fddf456ce61a84a974/cps/src/main/java/org/jenkinsci/plugins/workflow/cps/steps/ParallelStepExecution.java#L52-L58
.

Advice? Thoughts? Halp? =)

A.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAPbPdOaWkPx2bf1u6fnfG-%3D3kQejyD3p%2BM%2B4PqH6gL%2By%2B4mZHw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to