-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major
-
Component/s: workflow-cps-plugin
-
None
-
Environment:workflow-cps:2.7.1
-
workflow-cps 2.73
I currently work on a plugin ([Templating Engine Plugin|https://plugins.jenkins.io/templating-engine]) that relies on being able to leverage metaprogramming techniques such as using snippets like:
InvokerHelper.getMetaClass(impl).invokeMethod(impl, methodName, args)
or methodMissing to control program flow.Â
Â
The introduction of logging CPS mismatched method names has resulted in continuously logging these occurrences.Â
Â
Is there a way to work around the CPS mismatch logs for instances such as leveraging methodMissing or the InvokerHelper to dynamically execute methods?Â
Â
methodMissing log:
expected to call org.boozallen.plugins.jte.binding.injectors.StepWrapper.doThing but wound up catching org.boozallen.plugins.jte.binding.injectors.StepWrapper.methodMissing; see: https://jenkins.io/redirect/pipeline-cps-method-mismatches/ expected to call org.boozallen.plugins.jte.hooks.Hooks.invoke but wound up catching script15632181891161818312862.call; see: https://jenkins.io/redirect/pipeline-cps-method-mismatches/
InvokerHelper log:
expected to call groovy.lang.ExpandoMetaClass.invokeMethod but wound up catching script1563218188258613791966.doThing; see: https://jenkins.io/redirect/pipeline-cps-method-mismatches/
Â
Simplest example to reproduce:Â
Â
import org.codehaus.groovy.runtime.InvokerHelper c = { println "doing a thing" } InvokerHelper.getMetaClass(c).invokeMethod(c, "call", null)
Â
- is caused by
-
JENKINS-31314 Running asynchronous code inside a @NonCPS method should fail cleanly
-
- Resolved
-
- links to