Fix wildcard support in RemoveRedundantDependencies - #194
Merged
Conversation
…ndencies` The visitor guarded every removal candidate with a check that it did not match the recipe's `groupId`/`artifactId` globs. The intent was to avoid deleting the provider dependency itself, but the effect was to suppress removal of anything the glob matched. The wider the glob, the more it suppressed: `*`/`*` matched every declaration and made the recipe a complete no-op, and `spring-boot-starter-*` missed `spring-boot-starter-json` even though `spring-boot-starter-web` provides it. Record which direct dependency contributed each transitive on `TransitiveDependency.providedBy`, and skip only genuine self-provision rather than every glob match.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The visitor guarded every removal candidate with a check that it did not match the recipe’s
groupId/artifactIdglobs — intended to protect the provider dependency itself, but the effect was to suppress removal of anything the glob matched, so*/*was a complete no-op andspring-boot-starter-*missedspring-boot-starter-jsoneven thoughspring-boot-starter-webprovides it. This records which direct dependency contributed each transitive onTransitiveDependency.providedByand skips only genuine self-provision instead of every glob match. Adds seven tests covering match-all, wildcard artifactId,?, glob groupId, a guard that match-all does not over-delete, and two glob-matching starters where one provides the other — three of these fail without the fix and all 18 pre-existing tests still pass. Note thatTransitiveDependencyis a public accumulator type, so its shape changes here. The two Gradle tooling-API tests could not be exercised locally because this machine is being HTTP 429’d by Maven Central (the pre-existing one fails identically on unmodifiedmain), so they need CI to confirm.