Add Spring Data MongoDB 5 dependency alignment#1089
Conversation
- Rename recipe to UpgradeSpringDataMongoDb_5_0 for naming consistency - Drop extra spacing and comments from the MongoDB recipe list - Return assertions directly via .actual() in the test lambdas
|
It's not immediately clear to me how this relates to some of the newly opened issues:
Since we also already had
From our side we're fine to only have a single high over issue, with details only in the PR. That saves us from repeatedly triaging issues when the work is relatively straightforward. |
timtebeek
left a comment
There was a problem hiding this comment.
Thanks for the change here! I've applied a slight bit of polish, but we can merge once CI passes.
That makes sense. My intention was: #1082 covered the dependency alignment implemented by this PR. I’m happy to simplify this. I can close #1091, #1092, and #1093, keep the MongoDB roadmap consolidated under #1081, and put the detailed scope for each future change in its implementation PR instead. |
What changed
This branch is based directly on the current upstream
main; the Spring Data 4 foundation from Introduce Spring Data 4 migration foundation #1087 is already merged.Add
org.openrewrite.java.spring.data.MigrateSpringDataMongoDb5.Compose it into
UpgradeSpringData_4_0.Scope the recipe to modules that resolve
org.springframework.data:spring-data-mongodb, including transitive use through Spring Boot MongoDB starters.Upgrade explicitly versioned or unmanaged
spring-data-mongodb4.x dependencies to5.0.x.Align explicitly pinned, supported MongoDB Java Driver dependencies below 5.6 to
5.6.x.Keep managed, versionless dependencies versionless and remove stale explicit overrides when Spring Boot supplies the compatible target.
Preserve compatible forward overrides.
Leave MongoDB driver-only modules and deliberately excluded driver artifacts unchanged.
Regenerate
src/main/resources/META-INF/rewrite/recipes.csvusingrecipeCsvGenerate.Explicit MongoDB allow-list
The recipe aligns only these explicitly declared artifacts to
5.6.x:org.mongodb:mongodb-driver-bomorg.mongodb:mongodb-driver-coreorg.mongodb:mongodb-driver-syncorg.mongodb:mongodb-driver-reactivestreamsorg.mongodb:mongodb-cryptorg.mongodb:bsonorg.mongodb:bson-record-codecorg.mongodb:mongodb-driver-legacyBoundary decisions
mongodb-driver-bomis upgraded first, while dependencies managed by the BOM remain versionless.mongodb-driver-legacyis version-aligned but is not replaced withmongodb-driver-sync; artifact and API replacement belongs in a separate source migration.org.mongodb:mongo-java-driveruber JAR is not rewritten to a nonexistent 5.6 line.Dependency behaviour covered
Tests
The clean rebased branch passed all of the following in GitHub Actions run
29866417761:./gradlew recipeCsvValidateCompleteness --stacktrace ./gradlew test \ --tests org.openrewrite.java.spring.data.MigrateSpringDataMongoDb5Test \ --tests org.openrewrite.java.spring.data.UpgradeSpringData_4_0Test \ --stacktrace ./gradlew --console=plain --info --stacktrace --warning-mode=all --no-daemon buildTest coverage includes Maven and Gradle dependencies, managed and unmanaged versions, MongoDB Driver BOM management, transitive Spring Boot starter use, compatible forward overrides, excluded artifacts, unrelated driver-only modules, and integration through
UpgradeSpringData_4_0.Metadata
recipeCsvGenerateaddedMigrateSpringDataMongoDb5with a recipe count of 10 and updatedUpgradeSpringData_4_0from 21 to 31 composed recipes.