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

Update openrewrite + Camel recipe #21

Merged
merged 4 commits into from
Jan 23, 2025

Conversation

Croway
Copy link
Contributor

@Croway Croway commented Jan 22, 2025

  • Update Openrewrite to 2.23.1
  • Created latest.yaml Camel recipe, this recipe will update Camel 3.latest application to the latest 4.x mvn --no-transfer-progress org.openrewrite.maven:rewrite-maven-plugin:6.0.4:run -Drewrite.recipeArtifactCoordinates=org.apache.camel.upgrade:camel-upgrade-recipes:4.9.0 -Drewrite.activeRecipes=org.apache.camel.upgrade.CamelMigrationRecipe the recipe updates Camel versions and upgrade projects to java 17

@davsclaus
Copy link
Contributor

Camel 4.10 is using SB 3.4.x
https://github.com/apache/camel-spring-boot/blob/main/pom.xml#L111

Camel 4.9 is also using SB 3.4.x
https://github.com/apache/camel-spring-boot/blob/camel-spring-boot-4.9.0/pom.xml#L111

Camel 4.8 is using SB 3.3.x

@@ -33,7 +33,8 @@
<description>Migration recipes (using openrewrite) for Camel Spring Boot to make Maven migrations easier</description>

<properties>
<spring-rewrite-version>5.24.1</spring-rewrite-version>
<!-- Update this with each spring-rewrite release -->
<spring-rewrite-version>6.0.1</spring-rewrite-version>
Copy link
Contributor

Choose a reason for hiding this comment

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

The rewrite-recipe-bom:2.23.1 manages rewrites-spring:5.24.1.
https://repo1.maven.org/maven2/org/openrewrite/recipe/rewrite-recipe-bom/2.23.1/rewrite-recipe-bom-2.23.1.pom
OpenRewrite works best when versions released together are used together, to avoid any missing references when there are internal changes.

What's the reason to override that version here? And are you aware of the license change between 5.x and 6.x?
We recently made some accommodations to remove dependencies on MSAL modules for Quarkus in

rewrite-spring is one of those MSAL modules, so can't itself be removed without a loss of function. The managed older version is still Apache licensed, so could be used until the way forward is clear.

Suggested change
<spring-rewrite-version>6.0.1</spring-rewrite-version>
<spring-rewrite-version>5.24.1</spring-rewrite-version>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello @timtebeek thanks a lot for your input, I just removed the properties section and the version, so that the BOM handles it.

I was hoping for org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_4 recipe, this is why I updated the version, but that recipe has not been released yet, therefore, I think that right now this is the best we can achieve, but, once UpgradeSpringBoot_3_4 we'll have to update either bom version or rewrite-spring version.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good! Indeed best to rely on the rewrite-recipe-bom version for a compatible recipe module release. We release every two weeks, so expect an update regularly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry to bother you @timtebeek , but I think this situation is a corner case, the Apache Camel release 4.9.0 uses Spring Boot 3.4.x, but the upgrade for SB 3.4 has not released yet, therefore I think we have the following approaches:

  • Wait for the SB 3_4 recipe release before releasing camel-upgrade-recipes 4.9.0 (not great from my point of view, @davsclaus do you have any comment about it?)
  • Use the SpringBoot_3_3 upgrade recipe and update Spring Boot versions to 3.4.x via org.openrewrite.maven.UpgradeDependencyVersion (there may be issues, SB upgrades are stable, but you never know..)
  • Do not upgrade Spring Boot at all

Do you have any suggestions?

Copy link
Contributor

Choose a reason for hiding this comment

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

No problem at all! Does Camel 4.9.0 use Spring Boot in a way that's incompatible with Spring Boot 3.3? Or is it merely that it's built against 3.4 but expected to mostly still work with 3.3 if that part is not upgraded?

It might be some time before a public 3.4 recipe is available, as seen from the issue:

Internally we're further along, but there's no set timeline if or when that will become available, although any help is of course welcome.

As for your options now: I think you're likely fine to keep the Spring Boot 3.3 recipe in there; to be swapped out for 3.4 when available. I'm not sure how much users of Apache Camel have come to rely upon the recipes you provide to also upgrade their Spring Boot version, but documenting that some work might be required there could go a long way as well.

@Croway Croway force-pushed the camel-latest-upgrade-recipe branch from 56fdd8d to 17e0eef Compare January 22, 2025 17:22
@davsclaus
Copy link
Contributor

No problem at all! Does Camel 4.9.0 use Spring Boot in a way that's incompatible with Spring Boot 3.3? Or is it merely that it's built against 3.4 but expected to mostly still work with 3.3 if that part is not upgraded?

I do not recall any breaking changes etc so I would expect Camel 4.9/4.10 to also run on SB 3.3.x. We just dont have capacity to do throughly testing of N+ versions of SB for a given Camel release and as such we test with latest release, hence the 3.3 -> 3.4 upgrade.

@Croway Croway merged commit 3fa8d50 into apache:main Jan 23, 2025
1 check passed
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.

5 participants