Interview Prep/Jenkins/Scripted pipeline, Groovy & CPS

What is CPS and why does Jenkins transform pipeline Groovy?

AdvancedConceptScripted pipeline, Groovy & CPS
Answer

CPS (continuation-passing style) is a program transformation done by the workflow-cps plugin (using groovy-cps). Each pipeline method is rewritten so that its execution state (call stack, local variables, program counter) is an explicit object that can be serialized to disk. That makes pipelines durable: Jenkins can persist the program after each step and resume it after a controller restart. The cost: slower execution, restrictions on Groovy features, and the requirement that all live variables be Serializable.

All Jenkins questions Roadmap: Jenkins

More on Scripted pipeline, Groovy & CPS