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

Migrate to Spring Boot 3.3 led to tasks.withType being added to settings.gradle instead of build.gradle #654

Closed
DovOps opened this issue Dec 31, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@DovOps
Copy link

DovOps commented Dec 31, 2024

What version of OpenRewrite are you using?

Ran with the latest version of rewrite-spring deployed to the app tenant of Moderne.
5.26.0 (snapshot shown below)

image

How are you running OpenRewrite?

Ran moderne on an open source project, and it produced the following commit:

finos/traderX@109320d

This appears to have put the tasks.withType(Test) directives into settings.gradle when that file usually does not have access to tasks.

What is the smallest, simplest way to reproduce the problem?

Run this recipe on the https://github.com/finos/traderX repo in the app tenant.

What did you expect to see?

If any unit tests changes were made, tasks.withType would appear in build.gradle

What did you see instead?

This change was made in settings.gradle which prevented me from building the project until it was removed.

Here's an example of an older run where this change was only made in one build.gradle
DovOps/traderX@0474421

Compare that to this change, which made the undesired changes to settings.gradle
DovOps/traderX@109320d

What is the full stack trace of any errors you encountered?

n/a

Are you interested in [contributing a fix to OpenRewrite]

Happy to contribute. Unsure if this is something wrong with my setup, or something strange happening in the recipe; At first glance I could not see a change where this was introduced, though I know this has not happened in the past.

@DovOps DovOps added the bug Something isn't working label Dec 31, 2024
@timtebeek timtebeek moved this to Backlog in OpenRewrite Dec 31, 2024
@timtebeek
Copy link
Contributor

timtebeek commented Dec 31, 2024

hi @DovOps ! Indeed seems like that change should not be there; I've ran the same recipe against the public FINOS org and am seeing the same changes on traderX.
image

There's not been any recent changes to GradleUseJunitJupiter:
https://github.com/openrewrite/rewrite-testing-frameworks/commits/main/src/main/java/org/openrewrite/java/testing/junit5/GradleUseJunitJupiter.java

I do notice the recipe does not use any preconditions just yet, whereas it might make sense to use IsBuildGradle there. 🤔 We'll look into this on our end as well!

@timtebeek
Copy link
Contributor

Added the precondition and from my local tests that indeed fixes the issue; I'll redeploy the recipe jar to fix it on app.moderne.io as well. Thanks again for raising the issue, and all the best heading into the new year!

@DovOps
Copy link
Author

DovOps commented Dec 31, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants