-
Notifications
You must be signed in to change notification settings - Fork 354
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
Updating a BOM drops the version of untouched dependencies #4679
Comments
hi @gsmet ; Thanks for reporting here! From the original bug report it's not clear if the change is merely unexpected, or problematic. As a bit of context: we don't necessarily strive for a minimal change, as much as we strive for the idiomatic change. When folks add or change the parent, that to us means also removing any redundant explicit versions, as verified here: rewrite/rewrite-maven/src/test/java/org/openrewrite/maven/ChangeParentPomTest.java Lines 801 to 931 in 36efd20
Similarly, if a new parent no longer manages a dependency, we should introduce the explicit version such that we do not break the project. We found both cases easier to integrate directly into the ChangeParentPom, as opposed to having to call a second/third recipe for that type of change, or having to be explicit about any dependencies now or no longer managed. I hope that explains why we're making this change; the question now then is whether that's something to tweak or fix in case there's any problems. I'll cross post to the original issue for visibility to get more input and save you a step. |
For me, the issue is that when you point to very precise version, I don't think that "oh, the version is the aligned with the BOM now, let's drop it" always flies.
At the moment, in the former case, the decision taken by OpenRewrite is incorrect and will lead to issues next time the BOM updates this dependency. |
How about an option for this? |
I suppose it would need to be a global option applied to the whole process as this change might get done at any time when the model is updated? |
What version of OpenRewrite are you using?
I am using
How are you running OpenRewrite?
I just execute the following:
at the root of the project.
What is the smallest, simplest way to reproduce the problem?
This problem was initially reported by @siewp in quarkusio/quarkus#44529 .
I stripped down their reproducer a bit.
Unzip this tiny reproducer:
update-bom-drops-version.zip
Execute:
What did you expect to see?
I would expect the version of
protobuf-java
to stay untouched as I didn't perform any change on this dependency:What did you see instead?
The version is gone:
I think this issue is quite problematic as OpenRewrite usually does an excellent job at making the changes minimal.
The text was updated successfully, but these errors were encountered: