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

Migrating Spring Boot 1.5 to 2.7 and facing issues in MongoDB #547

Open
aakash03chaudhari opened this issue Jun 28, 2024 · 2 comments
Open
Labels
recipe Recipe requested

Comments

@aakash03chaudhari
Copy link

What problem are you trying to solve?

We attempted to migrate our project from Spring Boot 1.5 to 2.7. Our current project uses MongoDB, but the MongoDB code has not been fully migrated. For example:

The following:

public BulkWriteOperation bulkLoader;
public BulkWriteOperation bulkLoaderForBreakendInfo;

should be converted to:

public BulkOperations bulkLoader;
public BulkOperations bulkLoaderForBreakendInfo;

  1. BasicDBObject should be converted to Document.

To facilitate the migration, we added the OpenRewrite plugins to our pom.xml and ran the recipe using mvn rewrite:run.

Here's the relevant part of our pom.xml:

org.openrewrite.maven rewrite-maven-plugin 5.34.0 org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_7 org.openrewrite.recipe rewrite-spring 5.13.2
@timtebeek
Copy link
Contributor

Thanks for logging an issue! I think it should be fairly easy to cover these cases, if all we have to do is change those types. YOu can see an example here:

- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: org.springdoc.core.SpringDocUtils
newFullyQualifiedTypeName: org.springdoc.core.utils.SpringDocUtils

In this case we'll want to work out what version of Spring Boot necessitates the change, and then add that change to the corresponding yml file under https://github.com/openrewrite/rewrite-spring/tree/d49e38ed41300f6234cabc9794fce3959912f894/src/main/resources/META-INF/rewrite

Would love it if you're open to contribute that change. Even a draft PR would help kick this off and get it included in next week's release.

@timtebeek timtebeek added the recipe Recipe requested label Jun 28, 2024
@timtebeek timtebeek moved this to Recipes Wanted in OpenRewrite Jun 28, 2024
@bsmahi
Copy link
Contributor

bsmahi commented Jul 16, 2024

Hi @aakash03chaudhari
For BulkWriteOperation, BulkOperations, and BasicDBObject
Could you please help me with the package name for the above and if any other packages you need recipes, I will help you with the recipe.

Is BulkWriteOperation comes with com.mongodb.BulkWriteOperation?

Thanks,
Mahi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
recipe Recipe requested
Projects
Status: Recipes Wanted
Development

No branches or pull requests

3 participants