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

Attempt not to run boot upgrade 1.x -> 2.x for projects on 2.x already #543

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/main/resources/META-INF/rewrite/spring-boot-20.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ description: >
tags:
- spring
- boot
preconditions:
- org.openrewrite.java.dependencies.DependencyInsight:
groupIdPattern: org.springframework
artifactIdPattern: spring-core
version: 4.x
recipeList:
Copy link
Collaborator

@nmck257 nmck257 Jul 15, 2024

Choose a reason for hiding this comment

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

I'd like to move this precondition to a narrower subrecipe -- right now, it's fully halting the "chain" of each upgrade recipe calling the previous, It also means that recipes such as SpringBoot2BestPractices are no longer run for projects starting on newer Spring versions, which is perhaps unexpected and I'd say undesirable.

Maybe I move the precondition to MigrateHibernateConstraintsToJavax? Any concerns @BoykoAlex ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that still makes the unit test that I've added to pass. Perhaps we can narrow down the check as well to jakarta.validation-api transient dependency presence.

# Upgrade 2.0.x from 1.x
- org.openrewrite.java.dependencies.UpgradeDependencyVersion:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,8 @@ void xmlBindMissing() {
<properties>
<java.version>17</java.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
Expand Down