-
Bug
-
Resolution: Fixed
-
Critical
-
Jenkins LTS 1.580.2 and workflow-plugin 1.1. Both are the latest versions at the time of this writing. Tested on RHEL 6 with OpenJDK 1.7 and Fedora 21 with OpenJDK 1.8.
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 "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
- blocks
-
JENKINS-40864 Cannot execute Git branch list command in order to populate dynamically a choice pipeline property component
- Resolved
- depends on
-
JENKINS-34064 Pipeline builds do not run after Groovy 2.x upgrade
- Resolved
-
JENKINS-27421 Unserializable iterator & entry classes from Java Collections
- Resolved
- is blocked by
-
JENKINS-44924 pipeline groovy script - Sort a list with custom comparator or closure not sorting
- In Progress
-
JENKINS-44578 StackOverflowError in CpsTransformer running Declarative on JVMs with small -Xss in workflow-cps 2.33
- Resolved
-
JENKINS-46703 File.eachFileRecurse(FileType.FILES) and File.eachDirRecurse() only loops for first element
- Resolved
- is duplicated by
-
JENKINS-38268 Parallel step and closure scope
- Resolved
-
JENKINS-28276 Map collectEntries closure not behaving correctly
- Resolved
-
JENKINS-32451 Collection.find returns boolean
- Resolved
-
JENKINS-37303 .eachDir() iterate only once
- Resolved
-
JENKINS-38052 Pipeline parallel map not supporting curried closures
- Resolved
-
JENKINS-42635 Passing Closures to NonCPS Library Function give strange results
- Resolved
-
JENKINS-42769 NonCPS function returns wrong results!
- Resolved
-
JENKINS-26699 Workflow plugin silently breaks regular Groovy maps
- Resolved
-
JENKINS-35637 Pipeline plugin groovy interpreter does not interpret splitEachLine() for all lines
- Resolved
-
JENKINS-40339 Jenkins parallel pipeline: All subroutine calls in parameter blocks pass arguments from last block
- Resolved
-
JENKINS-41493 each and collect methods on lists do not work properly
- Resolved
-
JENKINS-43519 security sandbox should whitelist #eachWithIndex
- Resolved
- is related to
-
JENKINS-26300 CPS interpreter fails on calls to find(), findAll() default methods
- Resolved
-
JENKINS-31314 Running asynchronous code inside a @NonCPS method should fail cleanly
- Resolved
-
JENKINS-28599 Inconsistent behavior of collect
- Resolved
- relates to
-
JENKINS-46747 Reader.forEachLine only reads first line
- Open
-
JENKINS-46749 .collect, then .each still results in closure being invoked only for first element
- Open
-
JENKINS-41189 [Pipeline] Some non-CPS transformable code will not throw errors
- Resolved
-
JENKINS-54982 Using Java8 Streams evaluates whole expression to Boolean
- Open
-
JENKINS-42024 Silent error : UnsupportedOperationExceptions are not raised when using each/find
- Resolved
- links to