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

Fix failing test and infinity loop in MavenPomDownloader #4609

Merged
merged 5 commits into from
Oct 27, 2024

Conversation

marcel-gepardec
Copy link
Contributor

@marcel-gepardec marcel-gepardec commented Oct 24, 2024

I'm really sorry for solving the problem so late. @philippe-granet

What's changed?

I fixed the problem by implementing a method called resolveGav(). This uses the already available mergeProperties method to see if the property for the version is located in one of the modules.

What's your motivation?

Since it was my own fault

and the attempt to fix this problem led to a failing test

My sincere apologies for producing such a catastrophe.

@timtebeek
Copy link
Contributor

Hi @marcel-gepardec ; No worries about the earlier failures! :) Thanks for coming back here with a proposed fix. I do notice that there's still some failures in the tests; did you already explore those?

MavenParserTest > multipleCiFriendlyVersionPlaceholders() FAILED
    java.lang.IllegalArgumentException: Illegal character in path at index 57: file:///home/runner/.m2/repository/bogus/example/parent/${revision}${changelist}/parent-${revision}${changelist}.pom
        at java.base/java.net.URI.create(URI.java:906)
        at org.openrewrite.maven.internal.MavenPomDownloader.download(MavenPomDownloader.java:554)

@timtebeek timtebeek added the bug Something isn't working label Oct 26, 2024
@timtebeek
Copy link
Contributor

timtebeek commented Oct 26, 2024

I've applied a few more simplifications; I hope you all agree! Now we immediately return if there's an exact match without replacements, or when there's a match after replacements. Only when neither of those cases is true do we continue to download.

Let me know if you agree and then we can merge this.

@timtebeek timtebeek merged commit 4ee1955 into openrewrite:main Oct 27, 2024
2 checks passed
@timtebeek timtebeek deleted the fix/fix-infinity-loop branch November 2, 2024 10:31
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

Successfully merging this pull request may close these issues.

2 participants