I have a config driven function call where the name of the function and the list of args are passed in. Also all the Groovy and most of the pipeline functionality I know has been learnt from Google today, so I am not entirely sure how to achieve the equivalent effect. I worked around it for now, but it is not pretty. I will go back and change it once this bug is resolved.
Still an issue. The following does not work in script block:
// Simplified example; In reality, there are a lot of defaultArguments to pass
def defaultArguments = [
"arg1": "arg1",
"arg2": "arg2"
]
if ( my_condition ) {
doStuff(*:defaultArguments, foo: "bar")
} else {
doStuff(*:defaultArguments, foo: "cux")
}
General error during canonicalization: java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
at com.cloudbees.groovy.cps.CpsTransformer.visitSpreadMapExpression(CpsTransformer.java:1207)
// etc...