Skip to content

Conversation

@jglick
Copy link
Member

@jglick jglick commented Jan 18, 2024

I found myself using the StepExecutions utility a lot in jenkinsci/workflow-cps-plugin#834 but there were some limitations that made it awkward:

  • You needed to return null; even for synchronous steps which were not designed to return a value (the most common case), forcing use of a block-form lambda even for bodies consisting of a single statement.
  • The requirement that the body lambda be Serializable made for some awkward idioms. This was never productive since the body is used only in StepExecution.start, so even if the execution gets serialized, there is never a reason to deserialize the body.

After making those improvements I realized that the utility could actually be useful for production code, so opening it up outside of test scope. (Not helpful for existing steps since these need to retain serial form compatibility of the StepExecution implementation, except perhaps in the case of SynchronousStepExecutions.)

@jglick jglick requested a review from a team as a code owner January 18, 2024 16:39
jglick added a commit to jglick/workflow-cps-plugin that referenced this pull request Jan 18, 2024
@jglick jglick merged commit 03be811 into jenkinsci:master Jan 18, 2024
@jglick jglick deleted the StepExecutions branch January 18, 2024 17:04
jglick added a commit to jglick/workflow-cps-plugin that referenced this pull request Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants