Conversation
nkolev92
commented
May 18, 2022
nkolev92
commented
May 18, 2022
Member
Author
There was a problem hiding this comment.
I moved this test into a different class, because if you look at the other tests in this class they are all signing related CI only tests.
32cca57 to
feb4bbe
Compare
2bc400c to
5abdb0f
Compare
jeffkl
approved these changes
May 20, 2022
8 tasks
This file contains hidden or 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
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.
Bug
Fixes: https://github.com/NuGet/Client.Engineering/issues/1629
Regression? Last working version:
Description
This changes comes down to the functionality in NuGetPackageManager.
It is disjointed and it can be a bit challenging to find a spot to warn.
In the end, changes were needed in only 2 places, the preview install and update codepaths on a project level for packages.config projects only.
PackageReference projects warn by different means and uninstall scenarios in packages.config do not directly use any sources, but rather if need be, restore will be called.
You can use https://github.com/NuGet/Client.Engineering/issues/1523 for reference of all the scenarios I analyzed.
In addition to the automated tests, I validated manually that all scenarios warn correctly.
Here's the long description of my analysis of all
NuGetPackageManagermethods.Execute Actions:
ExecuteBuildIntegratedProjectActionsAsync - We don't really need to handle build integrated. PackageReference projets raise warnings in different places
ExecuteNuGetProjectActionsAsync - We won't warn in execute project actions, we'll do it in previews only.
ExecuteNuGetProjectActionsAsync - We won't warn in execute project actions, we'll do it in previews only.
ExecuteNuGetProjectActionsAsync - We won't warn in execute project actions, we'll do it in previews only.
PreviewBuildIntegratedProjectActionsAsync - We don't really need to handle build integrated. PackageReference projets raise warnings in different places
Install:
InstallPackageAsync - Calls one of the other ones.
InstallPackageAsync - Calls one of the other ones.
InstallPackageAsync - Calls one of the other ones.
InstallPackageAsync - Calls one of the other ones.
InstallPackageAsync - Calls one of the other ones.
InstallPackageAsync - Calls one of the other ones.
InstallPackageAsync - Calls bottom one
InstallPackageAsync - Calls PreviewInstallPackageAsync
PreviewInstallPackageAsync - Calls bottom one
PreviewInstallPackageAsync - Calls bottom one
PreviewInstallPackageAsync - Calls bottom one
PreviewInstallPackageAsync - Should be the one warning.
PreviewProjectsInstallPackageAsync - Calls one of the PreviewInstallPackageAsync eventually ending up in the same. By warning in the last
PreviewInstallPackageAsync, we'd be warning everywhere.Update:
PreviewUpdatePackagesAsync - All of these call
PreviewUpdatePackagesAsyncprivate method.PreviewUpdatePackagesAsync - All of these call
PreviewUpdatePackagesAsyncprivate method.PreviewUpdatePackagesAsync - All of these call
PreviewUpdatePackagesAsyncprivate method.PreviewUpdatePackagesAsync - All of these call
PreviewUpdatePackagesAsyncprivate method.PreviewUpdatePackagesAsync splits into build integrated and non-buiild integrated
We will warn in PreviewUpdatePackagesForClassicAsync for each project individually.
Uninstall:
UninstallPackageAsync -> Calls the preview ones.
PreviewProjectsUninstallPackageAsync - Calls PreviewUninstallPackageInternalAsync eventually. The trick is that in packages.config scenarios, there's no feed usage in
Uninstallflows. Potentially packages may berestoredprior to that, but that'll warn through a different codepath.PreviewUninstallPackageAsync -> both of these call PreviewUninstallPackageInternalAsync.
PreviewUninstallPackageAsync -> both of these call PreviewUninstallPackageInternalAsync.
Note that the tests in question are enough to cover all installation scenarios as the warning is being raised from
NuGetPackageManagerand all operations share that.PR Checklist
PR has a meaningful title
PR has a linked issue.
Described changes
Tests
Documentation