Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-46163] Add support for spread and spread-map operators #613

Merged
merged 4 commits into from
Nov 9, 2022

Conversation

dwnusbaum
Copy link
Member

See JENKINS-46163. This PR is a copy of cloudbees/groovy-cps#123, which was based on cloudbees/groovy-cps#116.

We follow the same approach as regular Groovy for SpreadMapExpression (the expression gets turned into a special SpreadMap by InvokerHelper.spreadMap, and then Map literals are constructed using InvokerHelper.createMap which detects this marker class and interpolates it).

We use a similar approach for SpreadExpression, but this is not the approach that Groovy itself uses. Some reasoning behind this choice is given in the Javadoc for SpreadBlock.

This PR also includes various improvements to the test harness (565b1ca) which have been copied from groovy-sandbox. I used them in the new tests and adapted existing tests to use the new assertion methods. The two commits can be reviewed independently.

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@jglick
Copy link
Member

jglick commented Nov 4, 2022

Do not forget to add release note labels before merging anything.

Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷

@car-roll car-roll enabled auto-merge November 9, 2022 15:51
@car-roll car-roll merged commit eaa8678 into jenkinsci:master Nov 9, 2022
@dwnusbaum dwnusbaum deleted the JENKINS-46163 branch November 9, 2022 16:36
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.

3 participants