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

Add OkHttp Recipe #647

Closed
wants to merge 1 commit into from
Closed

Add OkHttp Recipe #647

wants to merge 1 commit into from

Conversation

123Haynes
Copy link
Contributor

@123Haynes 123Haynes commented Dec 6, 2024

What's changed?

This PR adds a recipe that explicitly adds OkHttp as a dependency if it's used in the codebase.
I copied the OkHttp version from the spring-boot-dependencies.pom of Spring Boot 3.3.6.

What's your motivation?

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

I'm unsure if adding the okhttp jar directly to the classpath folder was the correct way to handle the requirement in the test case.

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

@timtebeek timtebeek marked this pull request as draft December 7, 2024 13:31
@timtebeek
Copy link
Contributor

Thanks for kicking this off! I think the issue is slightly different, and likely already handled by ChangeParentPom.

Previously a project using say the 3.3 parent from Spring Boot would not have to define a version for Okhttp, as that was a managed dependency. With 3.4 that managed dependency was removed, so folks would have to add an explicit version going forward. I believe the change parent pom recipe already takes care of that, so then we can keep this test around but likely do not require a dedicated recipe beyond changing the parent pom version.

@123Haynes
Copy link
Contributor Author

@timtebeek Thanks for pointing that out. I didn't know the ChangeParentPom recipe handled that case 😄
I'm fine with closing this PR then. I'll just treat it as a learning experience.

Maybe we should mark the TODO for OkHttp as completed in #642 then and add a comment that this will be handled by org.openrewrite.maven.UpgradeParentVersion when the final upgrade recipe is created.
looks like ChangeParentPom is not used directly in this repo so far, but instead UpgradeParentVersion is used which invokes it 😄

@123Haynes 123Haynes closed this Dec 7, 2024
@timtebeek
Copy link
Contributor

Good call; I've updated the TODO list, and added a reminder to check, possibly with the test you've added here. Thanks again!

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

Successfully merging this pull request may close these issues.

2 participants