Conversation
|
Team Review: Add unit tests for the two other code paths where the warning is logged |
f72d714 to
4d9725d
Compare
@NuGet/nuget-client |
nkolev92
left a comment
There was a problem hiding this comment.
You're missing packages.config restore in Visual Studio.
I assume you mean PC restore right?
Are you looking in PMC? |
|
Installation in packages.config is different from installation in PackageReference. We'll have a different issue for installation scenarios. |
|
I originally thought your branch didn't have my changes, but it seems like now does. How are you testing that the PR scenarios? I'll do some tests on my end, as that's something I expect to work. |
I just tested in VS PMUI and VS PMC with below 2 feeds. |
|
My question is more about what version of VS you are testing. Are you using experimental instance etc. |
|
Try using a legacy package reference project. For SDK based projects, the warnings are added in by the SDK and given that the SDK doesn't know about NU1803 it can't parse it. Root cause explained: NuGet/Home#7126 |
You're right it works for legacy PR warnings are added. Does above apply for package PMUI install of packages.config projects too? |
What does above mean? |
|
@NuGet/nuget-client |
|
When you say you |
test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/InstallCommandTests.cs
Outdated
Show resolved
Hide resolved
test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/RestoreCommandTests.cs
Outdated
Show resolved
Hide resolved
test/NuGet.Core.FuncTests/Msbuild.Integration.Test/MsbuildRestoreTaskTests.cs
Outdated
Show resolved
Hide resolved
test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/RestoreCommandTests.cs
Show resolved
Hide resolved
test/NuGet.Clients.FuncTests/NuGet.CommandLine.FuncTest/Commands/InstallCommandTests.cs
Show resolved
Hide resolved
| packageRestoreContext.Token.ThrowIfCancellationRequested(); | ||
|
|
||
| IEnumerable<SourceRepository> enabledSources = | ||
| packageRestoreContext |
There was a problem hiding this comment.
packageRestoreContext has the SourceRepositories. Can we use those?
There was a problem hiding this comment.
I think we can use packageRestoreContext.SourceRepositories because the collection is populated with sources that are enabled.
NuGet.Client/src/NuGet.Core/NuGet.Protocol/CachingSourceProvider.cs
Lines 33 to 36 in aca9465
There was a problem hiding this comment.
I had to add back this change, because some code paths sourceRepositories is set explicitly null so we can't use packageRestoreContext.SourceRepositories that case.
There was a problem hiding this comment.
I'd really love it if we can avoid adding any public methods in NuGetPackageManager.
I tried to follow RestorePackageAsync into NuGetPackageManager and it uses the ISourceRepositoryProvider to get the providers if they are not set on the context.
Maybe we can just set them?
|
@nkolev92 @kartheekp-ms |
cd707e8 to
25a1ec4
Compare
There was a problem hiding this comment.
I think we need to add log code to the warning. Similar to PR restore logic.
NuGet.Client/src/NuGet.Core/NuGet.Commands/RestoreCommand/RestoreCommand.cs
Lines 223 to 224 in f52a839
There was a problem hiding this comment.
log codes only work in PackageReference.
For consistency we try not to add the log codes in packages.config as none of the resolver warnings/errors have any codes.
There was a problem hiding this comment.
For consistency we try not to add the log codes in packages.config as none of the resolver warnings/errors have any codes.
I don't understand this. With a log code, the customer has something to search for (or in VS, something to click in the Error List window), and then there can be a docs page where we can provide more detailed instructions on how to resolve the error.
Why is consistency with not using log codes matter more than this?
There was a problem hiding this comment.
You can't suppress warnings or elevate warnings in packages.config. Log codes usually suggest that you can do that.
Also warnings/errors in packages.config and PackageReference are different because pc restore rarely puts any log messages there.
I think the message itself should be actionable enough.
e86a84c to
fe739a9
Compare











Bug
Fixes: https://github.com/NuGet/Client.Engineering/issues/1519
Regression? Last working version:
Description
Pretty straightforward. Contains the same warning as #4552, but obviously with a code since it's restore.
PR Checklist
PR has a meaningful title
PR has a linked issue.
Described changes
Tests
Documentation