-
Notifications
You must be signed in to change notification settings - Fork 339
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
Do not override version property placeholder in UpgradeDependencyVersion #4579
base: main
Are you sure you want to change the base?
Changes from 8 commits
ffef977
5468e68
d3f3382
1db63db
b65710b
0fb77bf
27c7f2c
8937a6d
c030b53
822bc95
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,82 @@ | |
|
||
class UpgradeDependencyVersionTest implements RewriteTest { | ||
|
||
@Test | ||
@Issue("https://github.com/openrewrite/rewrite-spring/issues/474") | ||
void upgradePropertyAdditionalCheck() { | ||
rewriteRun( | ||
spec -> spec.recipe(new UpgradeDependencyVersion("org.springframework", "*", "5.2.x", "", | ||
false, null)).expectedCyclesThatMakeChanges(2), | ||
mavenProject("project", | ||
//language=xml | ||
pomXml( | ||
""" | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.openrewrite.example</groupId> | ||
<artifactId>example</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<name>example</name> | ||
<description>Demo project for Spring Boot</description> | ||
<properties> | ||
<spring.boot.version>2.2.13.RELEASE</spring.boot.version> | ||
<spring.jms.version>5.2.22.RELEASE</spring.jms.version> | ||
</properties> | ||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-dependencies</artifactId> | ||
<version>${spring.boot.version}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-jms</artifactId> | ||
<version>${spring.jms.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
</project> | ||
""", | ||
""" | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.openrewrite.example</groupId> | ||
<artifactId>example</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<name>example</name> | ||
<description>Demo project for Spring Boot</description> | ||
<properties> | ||
<spring.boot.version>2.2.13.RELEASE</spring.boot.version> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This version property should be updated too, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed in the ticket it expects to upgade also the boot dependency, but this should be done in the rewrite-spring repository in this file resources/META-INF/rewrite/spring-framework-53.yml file In the rewrite-spring repository the recipe is invoked with the following properties I used the same for this test.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My bad, didn't read the group id properly, you are right :) |
||
<spring.jms.version>5.2.25.RELEASE</spring.jms.version> | ||
</properties> | ||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-dependencies</artifactId> | ||
<version>${spring.boot.version}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-jms</artifactId> | ||
<version>${spring.jms.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
</project> | ||
""" | ||
) | ||
) | ||
); | ||
} | ||
|
||
@Test | ||
void doNotOverrideImplicitProperty() { | ||
rewriteRun( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we check once more whether we can reduce the amount of cycles to 1?
Enforcing that all recipes complete in 1 cycle is something that's being looked at