-
Notifications
You must be signed in to change notification settings - Fork 332
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
Singlesource applicability with FindSourceFiles now applies changes to all files #2919
Comments
Thank you for reporting this here! I'm adding a couple of hopefully helpful links here to aid troubleshooting: I don't immediately see any relevant changes in the 261 commits. Would you mind testing any intermediate maven plugin versions to help narrow it down? Or provide the command you're using to perform your upgrades? |
hi @timtebeek , Sure I will bissect tomorrow and see if I can pinpoint it to one particular version. |
Thanks a lot! |
I think I found out what the issue is. My recipes targeting singleSource with wildcards are applied to all the files of the project, totally ignoring the applicability, AFAICS: I get:
(so OpenRewrite adjusting a while I have for
So this rule should only be applied to The upgrade starts being extremely slow as it applies all our text transformations to all the files instead of targeting only the ones in the I bissected and AFAICS the regression was introduced in OpenRewrite So unless I'm doing something incorrect (but that was working before), a regression was probably introduced in For reference, our recipes are hosted here: https://github.com/quarkusio/quarkus-updates/blob/main/recipes/src/main/resources/quarkus-updates/core/3alpha.yaml |
Thanks a lot both for bisecting where the behavior changed as well as providing the additional context around the recipe & applicability test used. It looks like you're using a pattern similar to what we have in the documentation, but curiously that's also the only place I see Would you mind giving this a try with |
So this was because applicability tests didn't apply correctly and was fixed here (which is in the commit range of differences that @timtebeek tagged in his earlier comment): Applicability tests were inappropriately selecting sources under the single source case, especially, which is what led to your issue here. If I were you, I'd try this again on the newest maven plugin and you should have much better luck. |
@shanman190 I don't think it's related given my problem is specifically with 7.37.0..7.37.3 and the commit you pointed out was introduced in 7.36.0. @timtebeek I'll give it a try but IIRC, the pattern we are using was pointed out by someone from the OpenRewrite team so we are probably not the only ones doing that. I'll post about my findings soon. |
@gsmet, I missed that on the first read; apologies about missing that! |
@timtebeek the issue is that I cannot use My understanding is that using |
@timtebeek any news? Asking that because I'm hitting another issue with 7.36.0 that seems to be fixed with the latest and I'm in an uncomfortable situation. Thanks! |
Understandable that you're looking to see this resolved; I don't have any immediate answers, but I've asked @kunli2 if he can chime in to see what (if any) changes need to be made to get you on the latest versions again. |
I started with Open Rewrite 4.40.0 iirc and did a migrate Java 11 with it. Wanted to do a migrate Java 17 but got the "[OpenRewrite: The contents of a quark are unknown, so the charset is unknown] bug. This was fixed in 4.41.1, so upgraded. Could now do the migration. Also noticed that in the Yaml files all new lines were indeed removed and now its all on 1 line. |
I would bet it could be related to 9b72d9a . I will try the version before this commit then the version after and report back. |
After some bisecting, I can confirm that 9b72d9a is the culprit. |
Thanks a lot for your efforts to really pin this down; hope @kunli2 is able to use that information for a fix or workaround. |
Unfortunately, in OpenRewrite 7.37.0+, there is a bug with singleSource and using a recipe. We can revert this patch once openrewrite/rewrite#2919 is fixed.
Thanks for all the useful findings so far, I start working on this now. |
this is fixed by #2962, I have verified the https://github.com/quarkiverse/quarkus-github-app and didn't see any unexpected changes. |
Thanks @kunli2 , I tested latest main and AFAICS the issue is gone! Looking forward to having a version of the Maven plugin coming with the fix! |
Hi,
I'm not sure if it's a problem with OpenRewrite itself or the Rewrite Maven plugin but after an upgrade to 4.41.0, the Rewrite Maven plugin starts pushing unwanted changes to my YAML and properties files.
When rewriting https://github.com/quarkiverse/quarkus-github-app with our Quarkus upgrade script, I end up with the following diff between a rewrite with 4.39.0 and a rewrite with 4.41.0:
(the private key is a test one that isn't used anywhere, no worries here)
So OpenRewrite is somehow:
That's not something I want so I'm wondering what is going on.
Let me know if it's more of a core issue that should be moved there.
Thanks.
The text was updated successfully, but these errors were encountered: