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

Refactor new dependency graph resolution algorithm #6231

Merged
merged 7 commits into from
Jan 24, 2025

Conversation

jeffkl
Copy link
Contributor

@jeffkl jeffkl commented Jan 16, 2025

Bug

Related: https://github.com/NuGet/Client.Engineering/issues/3008

Description

This is a major refactoring of the new dependency resolution algorithm to clean up the code and add more comments. Some of the changes include:

  • Abstracting out major parts of the logic into separate methods so that the main ResolveAsync() method is easier to read
  • Simplifying classes by trimming them down and combining them where it made sense
  • Add XML doc comments to all members
  • Make DependencyGraphResolver a partial class and move its child classes to separate files
  • Went line-by-line and renamed any variable so that it aligned with the final implementation

To validate these changes, I've run restores against some key repositories and verified that the performance is the same and soare the outputs. All tests are passing and the only test updates I made were to improve reliability. One of the tests depended on a specific order of packages which is no longer deterministic due to parallelization.

Once this is merged, I will be working on a markdown file explaining the design and implementation of the algorithm for future contributors.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@jeffkl jeffkl self-assigned this Jan 16, 2025
@jeffkl jeffkl requested a review from a team as a code owner January 16, 2025 19:07
@jeffkl jeffkl force-pushed the dev-jeffkl-dependencygraphresolver-refactor branch from f75e418 to b9d32cd Compare January 16, 2025 23:11
Copy link
Member

@nkolev92 nkolev92 left a comment

Choose a reason for hiding this comment

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

This is such great work.

I don't really have any big feedback, but a bunch of ideas and comments that I might not even have if we weren't refactoring.

@jeffkl jeffkl force-pushed the dev-jeffkl-dependencygraphresolver-refactor branch from fa380b9 to 9130624 Compare January 21, 2025 20:08
@jeffkl jeffkl requested a review from nkolev92 January 22, 2025 21:56
donnie-msft
donnie-msft previously approved these changes Jan 22, 2025
Copy link
Contributor

@donnie-msft donnie-msft left a comment

Choose a reason for hiding this comment

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

Impressively well-documented!

Copy link
Member

@nkolev92 nkolev92 left a comment

Choose a reason for hiding this comment

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

🚢 🚢 🚢 🚢 🚢

Copy link
Contributor

@Nigusu-Allehu Nigusu-Allehu left a comment

Choose a reason for hiding this comment

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

Thank you for the great documentation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants