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

jacoco upgrade now includes arbitrary jacoco deps (eg agent), always … #471

Merged
merged 3 commits into from
May 2, 2024

Conversation

nmck257
Copy link
Contributor

@nmck257 nmck257 commented May 2, 2024

…sends to highest patch version, and happens in the java 6 recipe (and therefore runs at every java upgrade)

What's changed?

see title

What's your motivation?

  • apps using offline instrumentation may also have the jacoco agent in their dependencies
  • pretty much any java upgrade might require a jacoco upgrade, depending on the initial version, and the current recipes only touched jacoco at certain versions

Anything in particular you'd like reviewers to focus on?

the test file has a reference to "latest jacoco version" which would need to be maintained over time for the tests to pass; I forget if we have a tidier pattern for cases like this

Anyone you would like to review specifically?

Have you considered any alternatives or workarounds?

Any additional context

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

…sends to highest patch version, and happens in the java 6 recipe (and therefore runs at every java upgrade)
@timtebeek timtebeek self-requested a review May 2, 2024 16:47
@timtebeek timtebeek added enhancement New feature or request recipe Recipe requested labels May 2, 2024
@timtebeek
Copy link
Contributor

Very quickly saving folks a quick if they get to this before I do

UpgradeToJava6Test > dataSource() FAILED
    java.lang.AssertionError: [Recipe validation must have no failures] 
    Expecting no elements of:
      [[Valid{property='initialization', value='org.openrewrite.config.DeclarativeRecipe@c746f615'},
        Valid{property='initialization', value='org.openrewrite.config.DeclarativeRecipe@c746f615'},
        Valid{property='initialization', value='org.openrewrite.config.DeclarativeRecipe@d1528c9'},
        Invalid{property='org.openrewrite.java.migrate.JREWrapperInterface.recipeList[0] (in rewrite.yml)', value='org.openrewrite.java.migrate.jacoco.UpgradeJaCoCo', message='recipe 'org.openrewrite.java.migrate.jacoco.UpgradeJaCoCo' does not exist.'},

@nmck257
Copy link
Contributor Author

nmck257 commented May 2, 2024

whoops, fixed - thanks!

Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

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

Thanks a lot! Cleaner indeed to have it all in one place. I didn't know JaCoCo is so strongly backwards compatible to older Java version; that sure makes this easier.

@nmck257
Copy link
Contributor Author

nmck257 commented May 2, 2024

Sure thing, thanks for adjusting the test case to avoid the hardcoded version!

@timtebeek timtebeek merged commit c82c73a into openrewrite:main May 2, 2024
2 checks passed
@timtebeek
Copy link
Contributor

Sure thing, thanks for adjusting the test case to avoid the hardcoded version!

Yeah just saving future me some time down the road. :) Didn't want to trouble you for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request recipe Recipe requested
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants