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

[MRESOLVER-390] Customize graph visiting strategy #322

Merged
merged 16 commits into from Oct 13, 2023

Conversation

cstamas
Copy link
Member

@cstamas cstamas commented Jul 27, 2023

Resolver (and thus Maven) had "wired in" strategy to flatten dependency graph into list, and it was always "preOrder", while there existed alternate solutions like "postOrder". This PR introduces "levelOrder" as asked by users, and also makes it configurable (via session config) which strategy should be used, and exposes helper classes and methods.

This PR introduces new visitors that are able to perform the 3 visiting strategies and uses them, while the old ones are left in place (for binary compatibility) but are NOT used in Resolver and their use is discouraged.

Now session can be configured to use following strategies to flatten the graph:

  • "preOrder" -- as before
  • "postOrder" -- was already present, but unused (unless some code used it directly)
  • "levelOrder" -- as asked by users, artifact list is ordered by their depth (distance from root)

By default, this PR introduces NO behavior changes, but opens configuration that does allow to alter these.


https://issues.apache.org/jira/browse/MRESOLVER-390

Originally it was always preOrder w/ possibility to change.
Introduced config and code to support:
* "preOrder" -- as before
* "postOrder" -- unsure who want this
* "levelOrder" -- as asked by users, artifact list is ordered by their level (distance from root)

---

https://issues.apache.org/jira/browse/MRESOLVER-390
@cstamas cstamas self-assigned this Jul 27, 2023
@cstamas cstamas added this to the 1.10.0 milestone Jul 28, 2023
@cstamas cstamas merged commit 6bc4c21 into apache:master Oct 13, 2023
10 checks passed
@cstamas cstamas deleted the MRESOLVER-390 branch October 13, 2023 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant