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

Generate a default closure in InterceptingGCL #510

Merged
merged 3 commits into from
May 16, 2022

Conversation

nestoracunablanco
Copy link
Contributor

In case a method is matched with null value closure, the default generated closure is {}.

This does not work when the method has more parameters, so the approach of generating a default closure using dynamic compilation was taken.

  • 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

Solves comments in issue #461

@nre-ableton nre-ableton changed the title Generates a default closure in InterceptingGCL Generate a default closure in InterceptingGCL Apr 11, 2022
Copy link
Contributor

@nre-ableton nre-ableton left a comment

Choose a reason for hiding this comment

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

There is a lot of logic going on in defaultClosure that isn't tested. It would be nice to have a unit test to make sure that all of the string slicing and appending works as expected.

Also, there is a typo in the commit message (it should be "Generate a default ..."). I fixed this in the PR title for you.

Nestor Acuna-Blanco added 2 commits April 15, 2022 14:52
In case a method is matched with null value closure, the default generated closure is {}.

This does not work when the method has more parameters, so the approach of generating a default closure using dynamic compilation was taken.
Also adds a verification for the maximum JVM allowed parameters.
@nestoracunablanco
Copy link
Contributor Author

@nre-ableton more unit tests are now in place.

Copy link
Contributor

@nre-ableton nre-ableton left a comment

Choose a reason for hiding this comment

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

I guess this change looks fine to me, but I am not sure I can speak to the broader impact that this change may have. It would be nice if @stchar could also take a look.

@nre-ableton nre-ableton requested a review from stchar April 20, 2022 11:42
@nestoracunablanco
Copy link
Contributor Author

Hi @stchar, can you please also take a look at this pull request? Thanks!

Copy link
Contributor

@stchar stchar left a comment

Choose a reason for hiding this comment

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

Awesome!

@stchar
Copy link
Contributor

stchar commented May 16, 2022

@nestoracunablanco, @nre-ableton, reviewed. Looks good.
I would also add tests for scripted pipeline, but I assume there is no any difference as InterceptingGCL address to metaclass of groovy.lang.Script which is the same in case of Declarative and Scripted pipeline test runs.

@nre-ableton nre-ableton merged commit 15e2466 into jenkinsci:master May 16, 2022
@nestoracunablanco
Copy link
Contributor Author

Thanks for the nice feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants