Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-58620

expected to call CpsGroovyShell.evaluate but wound up catching <something>.run

    Details

    • Similar Issues:

      Description

      We found a change that prints an annoying warning about the CPS mismatch during running the MPL module: https://github.com/griddynamics/mpl/issues/31

      Running on Jenkins in /var/jenkins_home/workspace/mpl-master
      [Pipeline] {
      [Pipeline] stage
      [Pipeline] { (Checkout)
      [Pipeline] fileExists
      expected to call org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.evaluate but wound up catching Checkout.run; see: https://jenkins.io/redirect/pipeline-cps-method-mismatches/

      We're not quite sure how to fix that in the library, but realized that the issue is related to the change JENKINS-31314 introduced in workflow-cps-2.71.

      Reproduce is quite simple - just need to install the minimal latest jenkins, add required git & shared lib plugins, attach mpl library from github and create a simple jenkins job to build the mpl. It will fail (no Maven 3 tool) - but will show the issue during each module start.

      Who could help with determining the actual cause and how to fix that?

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            A patch to groovy-cps as in #2 would be the appropriate fix, I think. If we are entering certain overloads of GroovyShell.evaluate and we get a continuation from some Script.run implementation, then all is well and there should be no warning.

            Show
            jglick Jesse Glick added a comment - A patch to groovy-cps as in #2 would be the appropriate fix, I think. If we are entering certain overloads of GroovyShell.evaluate and we get a continuation from some Script.run implementation, then all is well and there should be no warning.
            Hide
            sparshev Sergei Parshev added a comment -

            Thank you, I will prepare an implementation with tests for this case.

            Show
            sparshev Sergei Parshev added a comment - Thank you, I will prepare an implementation with tests for this case.
            Hide
            sparshev Sergei Parshev added a comment -

            Ok, just prepared a couple of PR's:

            Jesse Glick could you please check them?

            Show
            sparshev Sergei Parshev added a comment - Ok, just prepared a couple of PR's: https://github.com/cloudbees/groovy-cps/pull/101 - with the exception implementation https://github.com/jenkinsci/workflow-cps-plugin/pull/315 - with the test of the minimal Jenkinsfile Jesse Glick could you please check them?
            Hide
            abayer Andrew Bayer added a comment -

            I've merged the groovy-cps PR and will be cutting a release today.

            Show
            abayer Andrew Bayer added a comment - I've merged the groovy-cps PR and will be cutting a release today.
            Hide
            sparshev Sergei Parshev added a comment -

            The changes of PR#315 was merged to the master of workflow-cps-plugin - so hopefully will be available in the next release 2.75

            Show
            sparshev Sergei Parshev added a comment - The changes of PR#315 was merged to the master of workflow-cps-plugin - so hopefully will be available in the next release 2.75

              People

              • Assignee:
                sparshev Sergei Parshev
                Reporter:
                sparshev Sergei Parshev
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: