-
Notifications
You must be signed in to change notification settings - Fork 127
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
[MRESOLVER-345] Conflict resolution in verbose mode is sensitive to version ordering #271
Merged
cstamas
merged 14 commits into
apache:master
from
cstamas:MRESOLVER-345-collect-w-ranges
Mar 24, 2023
Merged
[MRESOLVER-345] Conflict resolution in verbose mode is sensitive to version ordering #271
cstamas
merged 14 commits into
apache:master
from
cstamas:MRESOLVER-345-collect-w-ranges
Mar 24, 2023
Conversation
This file contains 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
The two collector behave differently when in transitive dependencies ranges are in use. --- https://issues.apache.org/jira/browse/MRESOLVER-345
cstamas
changed the title
[MRESOLVER-345] BD and DF collect differences with ranges
[MRESOLVER-345] Conflict resolution in verbose mode is sensitive to version ordering
Mar 22, 2023
*/ | ||
public class ConsoleDependencyGraphDumper implements DependencyVisitor { | ||
public class DependencyGraphDumper implements DependencyVisitor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 - we have similar implementation in many places
slawekjaranowski
approved these changes
Mar 23, 2023
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.
Our two collector implementations produce slightly different dirty trees when in transitive dependencies ranges are in use. The new BF produces (w/ and w/o skipper) produces this dirty tree:
The "old" DF produces this one:
Spot the difference: the two dirty trees are "semantically" (or content-wise?) equal/same, except for the artifact ordering, where there was a version range (collector in this case discovers available versions that "fits" range and created nodes for them, one for each version that lies within version constraint). DF collector relies and provides "metadata based" ordering (as metadata contained the versions), while BF explicitly sorts them in descending order (for internal optimization purposes). Point is, both dirty trees are ok.
But, Conflict resolver in verbose mode for two inputs above produces different outputs. For DF with "divergence found", while for BF "no divergence found" (correctly).
Overall changes in this PR:
DependencyGraphDumper
ConflictResolver
covered byConflictResolverTest
UT changesConflictResolver
insensitive to input dirty tree version ordering, make sure output is same for "semantically" (or content-wise?) same inputs.How tested this:
Just realized how enforcer ITs are good source of inspiration for resolver use cases, so many if not all of new tests are actually inspired by enforcer ITs.
https://issues.apache.org/jira/browse/MRESOLVER-345