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

Consolidate packages.config restore implementations by minimizing discrepancies #5628

Conversation

nkolev92
Copy link
Member

@nkolev92 nkolev92 commented Feb 9, 2024

Bug

Fixes: NuGet/Home#13233

Regression? Last working version:

Description

Unfortunately we have 3 different implementations of packages.config restore.
A lot of that is due to the difference in reading the packages and part of it is not wanting to make public APIs for PC restore.

Those 3 implementations are:

  • nuget.exe restore
  • msbuild.exe /t:restore
  • VS restore

There's a bunch of differences in how the PackageRestoreManager gets called. It's made my work for PC restore vulnerability checking challenging, because the calls are not unified.

The change here is primarily 1, always create a PackageRestoreData list with all packages rather than just the missing ones. The same amount of work is being done, the difference being that now we have PackageRestoreData list with all the data, which I can later use for vulnerability checking.

PR Checklist

  • PR has a meaningful title

  • PR has a linked issue.

  • Described changes

  • Tests

    • Automated tests added
    • OR
    • Test exception - refactoring - existing tests actually helped ensuring I got it right :D
    • OR
    • N/A
  • Documentation

    • Documentation PR or issue filled
    • OR
    • N/A

@nkolev92 nkolev92 marked this pull request as ready for review February 9, 2024 22:12
@nkolev92 nkolev92 requested a review from a team as a code owner February 9, 2024 22:12
@nkolev92 nkolev92 requested a review from jeffkl February 12, 2024 18:05
jeffkl
jeffkl previously approved these changes Feb 12, 2024
src/NuGet.Core/NuGet.Build.Tasks/BuildTasksUtility.cs Outdated Show resolved Hide resolved
Copy link
Contributor

@jeffkl jeffkl left a comment

Choose a reason for hiding this comment

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

Thanks!

@nkolev92 nkolev92 merged commit 2d388e3 into dev Feb 12, 2024
15 of 16 checks passed
@nkolev92 nkolev92 deleted the dev-nkolev92-consolidateRestoreImplementationsByMinimizingDiscrepancies branch February 12, 2024 22:05
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.

Consolidate packages.config restore implementations by minimizing discrepancies
2 participants