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

enable updating transitive dependencies with solver #10776

Merged
merged 3 commits into from
Oct 17, 2024

Conversation

brettfo
Copy link
Contributor

@brettfo brettfo commented Oct 10, 2024

Previously if updating a transitive dependency, it was just pinned and no conflict resolution was performed.

This PR fixes that by elevating the check for using the dependency solver up one function. This enables a transitive dependency to be fixed by updating the top-level package. The solver has always had this capability, but it was bypassed in the transitive case.

The following other changes were performed:

  • Add test helper DependencySolverEnvironment to make unit testing the dependency solver easier; fewer magic strings.
  • Rename ResolveDependencyConflictsNew => ResolveDependencyConflicts
  • Rename ResolveDependencyConflictsOld => ResolveDependencyConflictsWithBruteForce

@github-actions github-actions bot added the L: dotnet:nuget NuGet packages via nuget or dotnet label Oct 10, 2024
@@ -53,6 +60,54 @@ public static async Task UpdateDependencyAsync(
await SaveBuildFilesAsync(buildFiles, logger);
}

public static async Task UpdateDependencyWithConflictResolution(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This function is what enables the correct behavior; updating a transitive dependency by updating a top-level one.

@JamieMagee
Copy link
Contributor

@brettfo should this smoke test be merged too? dependabot/smoke-tests#219

@brettfo brettfo force-pushed the dev/brettfo/nuget-transitive-solve branch 2 times, most recently from 676f56e to eb32a82 Compare October 15, 2024 22:01
@brettfo brettfo marked this pull request as ready for review October 15, 2024 22:22
@brettfo brettfo requested a review from a team as a code owner October 15, 2024 22:22
@JamieMagee JamieMagee force-pushed the dev/brettfo/nuget-transitive-solve branch from d2cad34 to 4759dbd Compare October 17, 2024 15:52
@randhircs randhircs merged commit 1f44347 into main Oct 17, 2024
68 checks passed
@randhircs randhircs deleted the dev/brettfo/nuget-transitive-solve branch October 17, 2024 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: dotnet:nuget NuGet packages via nuget or dotnet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants