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

Fix library class equality across template and steps #282

Merged
merged 15 commits into from
Jun 9, 2022
Merged

Fix library class equality across template and steps #282

merged 15 commits into from
Jun 9, 2022

Conversation

steven-terrana
Copy link

@steven-terrana steven-terrana commented Jun 9, 2022

PR Details

fixes #279.

Resolves a bug involving class equivalency between steps and the template.

Description

While you could import a library class everywhere, it was actually a different version of that class due to disparate classloaders being used.

This PR resolves that by leveraging a common classloader across the pipeline template and each library step.

this also changes the initialization order of JTE.

Previously, it was:

  1. aggregate pipeline configs
  2. inject primitives
  3. determine pipeline template
  4. create and return CpsFlowExecution

it is now:

  1. aggregate pipeline configs
  2. determine pipeline template
  3. create CpsFlowExecution
  4. inject primitives
  5. return CpsFlowExecution

This change has no impact on end-users but allows JTE to pass the actual CpsFlowExecution to TemplatePrimitiveInjectors.

How Has This Been Tested

Tests added that reproduce failure.
Tests pass now.

Types of Changes

  • Added Unit Testing
  • Docs change / refactoring / dependency upgrade
  • 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 Jun 9, 2022
@steven-terrana steven-terrana marked this pull request as ready for review June 9, 2022 21:41
@steven-terrana steven-terrana changed the title [DRAFT]: Fix library class equality across template and steps Fix library class equality across template and steps Jun 9, 2022
@steven-terrana steven-terrana merged commit d3e8c0e into jenkinsci:main Jun 9, 2022
@steven-terrana steven-terrana deleted the fix-279 branch June 10, 2022 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: instanceof for library classes is false in template and other steps
1 participant