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

Expose JTE Primitives via GlobalVariables instead of the TemplateBinding #192

Merged
merged 16 commits into from
Apr 5, 2021
Merged

Expose JTE Primitives via GlobalVariables instead of the TemplateBinding #192

merged 16 commits into from
Apr 5, 2021

Conversation

steven-terrana
Copy link

@steven-terrana steven-terrana commented Apr 1, 2021

PR Details

This PR hopefully fixes #188 and all cases of

java.lang.UnsupportedOperationException: Refusing to marshal * for security reasons;

Description

Until now, all JTE Pipeline Primitives like steps, stages, keywords, application_environments were instantiated as objects and stored in a common TemplateBinding.

This TemplateBinding was needed several times in different contexts and was therefore stored as an InvisibleAction.

Objects serialized via Actions are subject to JEP-200 which meant that we needed to maintain a custom ClassFilterImpl.

This quickly grew unmanageable as it meant that any user defined variable in the binding would need to be added to the ClassFilterImpl.

This PR resolves the issue by demoting the role of TemplateBinding to that of a runtime collision detector and instead surfaces TemplatePrimitives via a GlobalVariableSet.

Overall, this was a pretty substantial PR:

50 files changed, 1526 insertions(+), 2496 deletions(-)

Fortunately, the change actually simplified JTE internals a bit.

How Has This Been Tested

Used myself for a week or so. Unit tests continuing to pass.

Types of Changes

  • Docs change / refactoring / dependency upgrade
  • Added Unit Testing
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have added the appropriate label for this PR
  • If necessary, I have updated the documentation accordingly.
  • All new and existing tests passed.

@steven-terrana steven-terrana added the bug Something isn't working label Apr 1, 2021
@cokieffebah cokieffebah added the internal-code-change A change without user-facing implications label Apr 2, 2021
@steven-terrana steven-terrana merged commit 2fc86d6 into jenkinsci:main Apr 5, 2021
@steven-terrana steven-terrana deleted the global-variables branch April 5, 2021 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working internal-code-change A change without user-facing implications
Projects
None yet
Development

Successfully merging this pull request may close these issues.

External library declarative pipeline marshal errors
2 participants