Skip to content

Conversation

timtebeek
Copy link
Member

@timtebeek timtebeek commented Aug 8, 2025

Dependencies can come in through various paths; at present we do not show the path of how dependencies come in in the data table rows. This may lead to duplicate rows, which we accept until we add a column to differentiate between rows (not a goal for this PR).

Before

We see a difference between Maven and Gradle DependencyInsight recipes: the Gradle recipe adds identical rows for the varying paths, whereas the Maven recipe does not add those identical rows.

After

Both recipes add rows for each path that might bring in a dependency, even if those rows might be identical.

@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Aug 8, 2025
@timtebeek timtebeek self-assigned this Aug 8, 2025
@timtebeek timtebeek requested a review from sambsnyd August 8, 2025 09:16
@timtebeek timtebeek added bug Something isn't working recipe Requested Recipe gradle labels Aug 8, 2025
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions could not be made:

  • rewrite-gradle/src/main/java/org/openrewrite/gradle/search/DependencyInsight.java
    • lines 22-22

@timtebeek timtebeek moved this from In Progress to Ready to Review in OpenRewrite Aug 8, 2025
@jevanlingen
Copy link
Contributor

Yep, looking good! I am only wondering about the maven counterpart. If maven's recipe can also have this same problem, I would add it in this PR as well.

@timtebeek
Copy link
Member Author

Adding some context here: the test uses rewrite-core, which indeed has three copies of jackson-core coming in

dependencies {
    implementation 'org.openrewrite:rewrite-core:7.39.1'
}
image

all three result in the same data table row before the changes made here.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions could not be made:

  • rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/GradleDependencyConfiguration.java
    • lines 33-33
    • lines 271-271

@jkschneider jkschneider marked this pull request as draft August 14, 2025 12:28
Copy link
Member

@jkschneider jkschneider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m pretty sure this is a non-goal in fact. Dependencies can come to be in multiple ways in a file. And there is utility in knowing how many times a dependency is included

@github-project-automation github-project-automation bot moved this from Ready to Review to In Progress in OpenRewrite Aug 14, 2025
@timtebeek timtebeek changed the title Prevent duplicate rows in Gradle DependencyInsight Ensure the Maven and Gradle DependencyInsights recipes treat dependencies coming in through various paths the same Aug 14, 2025
@timtebeek timtebeek removed the request for review from sambsnyd August 14, 2025 12:41
@timtebeek
Copy link
Member Author

As discussed in Slack: we'll instead change the Maven recipe to match Gradle, as opposed to changing the Gradle recipe to match Maven. We need to update the tests accordingly and the Maven DependencyInsight recipe. In the future we might add a column to distinguish between the data table rows produced.

@timtebeek timtebeek closed this Oct 18, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenRewrite Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working gradle recipe Requested Recipe

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants