×
Find plugins

Pipeline: Groovy2.41Minimum Jenkins requirement: 2.7.3ID: workflow-cps

Pipeline execution engine based on continuation passing style transformation of Groovy scripts.

A component of Pipeline Plugin.

Changelog

2.41 (Sept 28, 2017)

  • JENKINS-47071 - Allow .every.any, and other closure methods involving booleans to serialize properly.
  • Reduce memory of CPS code significantly by lazily initializing locals maps
  • JENKINS-44027 - Support multiple assignment in Pipeline scripts
  • JENKINS-32213 - Automatically make all CPS-transformed classes Serializable, no longer requiring that to be done explicitly.
  • Do not even offer PauseUnpauseAction unless you actually have CANCEL permissions

2.40 (Sept 5, 2017)

2.39 (Aug 7, 2017)

2.38 (Aug 1, 2017)

  • JENKINS-44548 Fix NullPointerException caused by corrupted FlowExecution records

2.37 (Jul 25, 2017)

  • Robustness fix involving StepContext.get(FlowNode) calls.
  • JENKINS-45109 Metastep display improvements useful especially for step and wrap calls in Blue Ocean.

  • JENKINS-31582 API for obtaining step arguments in more realistic form.

  • Improved logging of @script checkout.

2.36.1 (Jul 10, 2017)

2.36 (Jun 15, 2017)

  • Enabling whitelist entries to work for most Groovy built-in methods enabled in 2.33.
  • Timeouts in CpsFlowExecution.suspendAll could block Jenkins shutdown.

2.35 (Jun 13, 2017)

  • [38268@issue] Improper binding of local variables in closures.
  • Functional tests sometimes failed due to DSL finding no step definitions.

2.34 (Jun 03, 2017)

  • JENKINS-44578 Corrects a StackOverflowError seen on some JVMs with limited stack size running Declarative Pipelines after updating to 2.33.

2.33 (May 30, 2017)

Requires Jenkins 2.7.x or later.

  • JENKINS-26481 Most Groovy built-in methods taking closures (such as List.each) may now be used from Pipeline script without @NonCPS annotations. Certain less commonly used methods (such as sort taking a closure) are not yet implemented.

  • JENKINS-27421 Most Java methods returning iterators (such as looping over the result of Map.entrySet) may now be used from Pipeline script without @NonCPS annotations.

  • JENKINS-31967 Pipeline Syntax support for double values, as in the junit step for example.

  • JENKINS-43055 GraphListener may now be used as an extension point.

    GROOVY-6263 will affect Jenkins installations until Groovy 2.5.0 is integrated. Briefly, private methods may not be visible if called from an instance of a subclass of the class defining the method. The workaround is to relax the access restriction, for example to protected.

    Users of Declarative Pipeline should update to 2.34.

2.32 (May 24, 2017)

  • Timing feature in 2.31 introduced a memory leak when using shared libraries.

2.31 (May 22, 2017)

  • JENKINS-37324 Store and display arguments supplied to steps
  • JENKINS-44406 Fix a NullPointerException from StepDescriptorCache when the plugin providing the Step is uninstalled

  • Record timing information for various internal operations in Pipeline builds, available when support-core is installed.

  • Deleting program.dat when a build finishes.

2.30 (Apr 24, 2017)

2.29 (Mar 03, 2017)

  • JENKINS-33273 New option for script-from-SCM jobs to load the script directly, rather than performing a full checkout. Requires a compatible SCM, currently Git. Enabled by default for new jobs (falls back to heavyweight checkout where necessary).
  • JENKINS-42367 NullPointerException using params when certain kinds of parameter values were missing.

Pulls in SCM API Plugin 2.x; read this blog post.

2.28 (Feb 23, 2017)

  • JENKINS-42189 Problems in memory cleanup when using Groovy 2.4.8 (Jenkins 2.47+) could lead to deadlocks and/or large heap consumption.
  • Flow node IDs incorrectly skipped even numbers after around 500.

2.27 (Feb 13, 2017)

  • JENKINS-41945 NullPointerException during build cleanup, and consequent memory leak, under heavy load.
  • JENKINS-32986 Apply timeouts to some operations in the CPS VM thread.
  • Ensure build terminates after certain internal errors.

2.26 (Feb 07, 2017)

  • Pull in workflow-api 1.10 and refactor StepNode so that libraries can obtain Step info without depending on workflow-cps

2.25 (Feb 01, 2017)

  • JENKINS-39719 Cryptic error about overriding methods named like __cps__2 under certain conditions involving global libraries.
  • JENKINS-31484 Incorrect CPS translation of field references from getters and setters could lead to endless loops.

2.24 (Jan 17, 2016)

  • Reducing frequency of program.dat saves, avoiding some otherwise harmless serialization errors, and possibly improving performance for builds with complex Groovy logic.
  • Correcting two kinds of NullPointerException when loading old build records.
  • JENKINS-29656 Avoid failing the build merely because renaming a temporary file to program.dat fails, typically on Windows due to file locks from antivirus scanners.
  • JENKINS-38551 Invalid characters in GDSL.
  • Performance improvement related to StepDescriptor.

2.23 (Nov 07, 2016)

  • Fixed a number of memory leaks, extending fixes made in 2.12.
  • JENKINS-39456 Reduce memory footprint from graph of execution.
  • Language fixes, including support for:
    • super.method(…) calls
    • abstract methods
    • list to constructor coercion

2.22 (Nov 01, 2016)

  • Bug fix required for proper display of JENKINS-28385 in step reference.
  • JENKINS-39275 Cap the amount of time spent displaying one line of a virtual thread dump.
  • Text changes in Pipeline Syntax page.

2.21 (Oct 21, 2016)

  • JENKINS-39154 In-browser Pipeline script editor was broken in 2.20.

2.20 (Oct 20, 2016)

  • JENKINS-34637 timeout did not work when using most nested block steps.
  • Improved behavior on NotSerializableException such as in JENKINS-27421.

Do not use: see 2.21

2.19 (Oct 11, 2016)

  • JENKINS-35698 params now honors currently defined parameter definition defaults.
  • Global variables now take precedence over environment variables in case of ambiguity.
  • Clarifying and enforcing that params is read-only.

Addresses some issues related to params encountered in 2.18. In particular, a simple params.paramName now suffices to obtain a parameter including a fallback to its default value even in the first build of a branch project using properties.

2.18 (Sep 23, 2016)

  • JENKINS-29952 env.PROP may now be shortened simply to PROP when unambiguous. (Setting a variable still requires the prefix, or the withEnv step.)
  • JENKINS-27295 Build parameters may now be accessed via the params global variable, with typed values.
  • JENKINS-38114 currentBuild global variable documentation now displayed in full, rather than referring to build step documentation; and updated to better explain usage in light of changes in 2.14.
  • Unreproducible case of an error during build abort handling of a step making the build not abort cleanly.
  • Fixed a certain class of build hangs due to code mistakes, and improved error reporting for these cases.
  • Improved display in the build log of predictable problems resuming a build, such as cancellation of queue items for offline agents inside a node block.
  • Adding HTML anchors to the Global Variable Reference for easier linking.

You should also update the Pipeline Job Plugin to 2.7 or later, so that build parameters are defined as environment variables and thus accessible as if they were global Groovy variables.

Beware that binding['parameter.with-funny+characters'] will no longer work; use params['parameter.with-funny+characters'] instead. Also note that buildParameterName = 'new-value' will not work, since the fallback to env currently takes precedence over global variable bindings; better to treat build parameters as read-only and introduce a new local variable with def.

Similarly, if using ParametersDefinitionProperty from properties in a multibranch Jenkinsfile (including via the symbol parameters in Jenkins 2.x), the trick

binding.hasVariable('paramName') ? paramName : 'fallback'

for accessing the parameter value with a fallback in the initial build no longer works. You can now use the simpler

params.paramName ?: 'fallback'

or to maintain compatibility with installations with or without these changes:

env.paramName ?: binding.hasVariable('paramName') ? paramName : 'fallback'

2.17 (Sep 13, 2016)

  • JENKINS-38169 Regression in 2.14 affecting certain steps with a single parameter.

2.16 (Sep 13, 2016)

  • JENKINS-38167 Regression in 2.14 affecting certain usages of @Field.

2.15 (Sep 07, 2016)

  • JENKINS-38037 Regression in 2.14 affecting certain usages of symbols, such as with artifactArchiver in Jenkins 2.

2.14 (Sep 07, 2016)

  • JENKINS-29711 Fixed Snippet Generator output for steps taking a single array of arguments, and fixed the runtime for steps taking a single fixed argument, both with an implicit parameter name.
  • JENKINS-25623 Ability to abort/timeout an endless loop of Groovy code not inside any step.
  • Updated the Maven sample offered for fresh jobs.
  • Updated samples and code completion to use block-scoped stage from JENKINS-26107.
  • Fixed link text.
  • Infrastructure for JENKINS-31155.

Note that JENKINS-25623 makes some scripts fail which usually worked before, in case they used non-Serializable values in CPS-transformed code (i.e., regular Pipeline script). Such scripts were erroneous and may previously have failed (JENKINS-27421), albeit less commonly and less reproducibly. The Pipeline tutorial describes this scenario. Briefly, you can choose between

  • use a Pipeline-safe idiom like for (int i = 0; i < list.size(); i++) {handle(list[i])}
  • use for (def elt in list) {handle(elt)} if list is an ArrayList (i.e., usual Groovy [1, 2, 3] but not slices etc.)
  • wrap any Groovy code not calling steps in a method marked @NonCPS
  • delegate to external programs via sh/bat for any nontrivial computation

Note that if you are iterating the entrySet() of java.util.Map you will want to use this helper method:

@NonCPS def entrySet(m) {m.collect {k, v -> [key: k, value: v]}}

Note that 2.24 essentially reverts this change, but you are still advised to avoid even temporary use of nonserializable values.

2.13 (Aug 25, 2016)

  • JENKINS-37538 Trying to correct a regression in 2.12. Unreproducible but reported to affect usages of the Artifactory and Subversion plugins.

2.12 (Aug 15, 2016)

  • Correcting a memory leak introduced with the fix of JENKINS-36372, as well as a longstanding leak affecting only Jenkins 2.x.
  • Print a message whenever we are ready to resume running the program. Normally immediately after Resuming build but could be delayed for various reasons, such as offline agents.
  • Setting the thread context class loader, improving performance on systems running numerous Pipeline builds with complex Groovy scripts if you also update Script Security Plugin to 1.22.

2.11 (Aug 09, 2016)

  • JENKINS-29922 follow-up from 2.10: single-argument metasteps such as step and wrap should now display their delegates like first-class steps in Snippet Generator.
  • JENKINS-29922 follow-up from 2.10: error reporting for undefined functions now mentions available symbols as well as steps.
  • Include the running node count in Pipeline thread dumps in support bundles, to help estimate size of the Pipeline script and its libraries.
  • Infrastructure for JENKINS-34650.

2.10 (Jul 28, 2016)

  • JENKINS-29922 Simplified step call syntax available for certain cases where previously the $class notation was required.
  • JENKINS-25736 Ability to pause a running build.

2.9 (Jul 05, 2016)

  • JENKINS-36372 Root bindings not accessible to scripts loaded after restart.

2.8 (Jun 29, 2016)

  • JENKINS-31842 The virtual thread dump for a running build can now display information about the status of running steps.
  • JENKINS-36289 API for accessing Replay from Blue Ocean.

2.7 (Jun 27, 2016)

  • Some Snippet Generator forms were not using the correct job context since 2.3; affected Credentials dropdowns, for example.
  • Show the Pipeline Syntax link also from Replay screens.
  • Improved the Maven script sample in the inline editor.

2.6 (Jun 16, 2016)

  • JENKINS-26481 Pending a true fix for passing closures to “binary” methods such as Collection.each, the Pipeline build should now fail with an error message mentioning the issue, rather than silently behaving in an erratic fashion.
  • JENKINS-35395 Moving documentation for global variables into their own page for clarity.
  • Missing colon in editor snippet.
  • Infrastructure for JENKINS-26130: display information in the build log after Resuming build about what objects are still being loaded.

2.5 (Jun 09, 2016)

  • JENKINS-34281 workaround: some builds could fail to resume properly in a Jenkins installation with no anonymous read access, depending on how Jenkins was shut down.

2.4 (May 25, 2016)

  • Adding another link to Pipeline Syntax from a job configuration screen itself, to make it more prominent for Jenkins 2.x users without a sidebar.

2.3 (May 23, 2016)

  • JENKINS-31831 Moving Snippet Generator and related content to a new set of top-level pages under the label Pipeline Syntax.
  • API implementation useful for JENKINS-26107.

2.2 (May 02, 2016)

  • Enable the Groovy sandbox by default, even for administrators.
  • Improved log appearance of block-scoped steps.
  • JENKINS-25894 Better error reporting inside parallel.
  • Flow node graph improvement for load step.
  • JENKINS-26156 API problem in BodyInvoker.withDisplayName.

2.1 (Apr 06, 2016)

2.0 (Apr 05, 2016)

  • First release under per-plugin versioning scheme. See 1.x changelog for earlier releases.
  • JENKINS-26481 list.each {…} now works from Pipeline scripts (without @NonCPS).
  • JENKINS-27421 for (def x in list) {…} now works from Pipeline scripts (without @NonCPS).
ArchivesGet past versions
Labels
Previous Security Warnings