Repository navigation
Conversation
Author
|
Hi, friendly reminder! All CI checks passed on this PR. Could you take a look when you have a moment? Let me know if anything needs to be changed. Thanks! |
elharo
reviewed
Aug 19, 2026
|
|
||
| if (includes != null && !includes.isEmpty() && !includes.contains(key)) { | ||
| return true; | ||
| if (includesMatcher != null) { |
Contributor
There was a problem hiding this comment.
what if instead of a null check we used a matcher that matches everything as the default?
Member
|
please preserve line: form PR template in PR description |
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.
Summary
Fixes #998.
The
RequireUpperBoundDepsrule documentation states that theincludesparameter acceptsgroupId[:artifactId]format (withartifactIdbeing optional), but the implementation only supported exact string matching viaList.contains(). This meant specifying just agroupId(e.g.,com.example) would not match dependencies likecom.example:my-lib.Changes
RequireUpperBoundDepsVisitor.includesfromList<String>toPredicate<Artifact> includesMatcherArtifactUtils.prepareDependencyArtifactMatcher()to create the predicate — the same approach used byBannedDependencies,RequireReleaseDeps, and other rules that already supportgroupId[:artifactId]formatvisitEnter()to use the predicate instead of direct string comparisonTests
testIncludesWithGroupIdOnly()— verifies thatincludes = ["default-group"]correctly detects conflicts for dependencies with that groupIdtestIncludesWithGroupIdOnlyExcludesOtherGroup()— verifies thatincludes = ["other-group"]correctly ignores dependencies with a different groupId