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

Mishandling of binary methods accepting Closure

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      At least some closures are executed only once inside of Groovy CPS DSL scripts managed by the workflow plugin.

      Steps to reproduce:
      1. Create a new workflow with the following script:
      node {
      [1, 2, 3].each

      { println it }

      println "abc".replaceAll(/[a-z]/)

      { it.toUpperCase() }

      }
      2. Build the workflow

      Actual output:
      Started by user anonymous
      Running: Allocate node : Start
      Running on master in /var/lib/jenkins/jobs/testflow/workspace
      Running: Allocate node : Body : Start
      Running: Print Message
      1
      Running: Print Message
      A
      Running: Allocate node : Body : End
      Running: Allocate node : End
      Running: End of Workflow
      Finished: SUCCESS

      Expected output:
      Started by user anonymous
      Running: Allocate node : Start
      Running on master in /var/lib/jenkins/jobs/testflow/workspace
      Running: Allocate node : Body : Start
      Running: Print Message
      1
      Running: Print Message
      2
      Running: Print Message
      3
      Running: Print Message
      ABC
      Running: Allocate node : Body : End
      Running: Allocate node : End
      Running: End of Workflow
      Finished: SUCCESS

        Attachments

          Issue Links

            Activity

            Hide
            jbochenski Jakub Bochenski added a comment -

            I still have issues with this as described in JENKINS-46747

            Show
            jbochenski Jakub Bochenski added a comment - I still have issues with this as described in JENKINS-46747
            Hide
            jbochenski Jakub Bochenski added a comment -

            Another way this still fails: JENKINS-46749

            Show
            jbochenski Jakub Bochenski added a comment - Another way this still fails: JENKINS-46749
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: R. Tyler Croy
            Path:
            content/blog/2017/08/2017-09-08-enumerators-in-pipeline.adoc
            http://jenkins-ci.org/commit/jenkins.io/3ed6f8445ded8ddafec2e0e01b71ced9af0c6e7d
            Log:
            Add a nice little blog post about the despised JENKINS-26481

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: R. Tyler Croy Path: content/blog/2017/08/2017-09-08-enumerators-in-pipeline.adoc http://jenkins-ci.org/commit/jenkins.io/3ed6f8445ded8ddafec2e0e01b71ced9af0c6e7d Log: Add a nice little blog post about the despised JENKINS-26481
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: R. Tyler Croy
            Path:
            content/blog/2017/08/2017-09-08-enumerators-in-pipeline.adoc
            http://jenkins-ci.org/commit/jenkins.io/89792a0c8e0a3850f95ec5fe24bbc89f962fb7ed
            Log:
            Merge pull request #1120 from rtyler/enumerators

            Add a nice little blog post about the despised JENKINS-26481

            Compare: https://github.com/jenkins-infra/jenkins.io/compare/1c5922c91f13...89792a0c8e0a

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: R. Tyler Croy Path: content/blog/2017/08/2017-09-08-enumerators-in-pipeline.adoc http://jenkins-ci.org/commit/jenkins.io/89792a0c8e0a3850f95ec5fe24bbc89f962fb7ed Log: Merge pull request #1120 from rtyler/enumerators Add a nice little blog post about the despised JENKINS-26481 Compare: https://github.com/jenkins-infra/jenkins.io/compare/1c5922c91f13...89792a0c8e0a
            Hide
            lucasc Lucas Cimon added a comment -

            Thank you for fixing this !

            Show
            lucasc Lucas Cimon added a comment - Thank you for fixing this !

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                dtschan Daniel Tschan
              • Votes:
                108 Vote for this issue
                Watchers:
                134 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: