-
Notifications
You must be signed in to change notification settings - Fork 696
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
Create tracking file when user-profile nuget.config does not exist #4338
Conversation
I just realized this PR will cause problems for customers who started from a clean machine since #3907 shipped, and do not want to use nuget.org. If this PR is merged as-is, they will have nuget.org added to their user-profile one time. Since chocolatey claim that their fix has been released, perhaps we should just close this PR. I believe that Windows PowerShell (5.1)'s So, this will be an on-going issue for anyone who uses PowerShell 5.1's @JonDouglas thoughts? |
This seems like a net positive PR. I don't really see the downsides here as this issue crops up time from time and looks like this may help future proof it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments. Looks good.
src/NuGet.Core/NuGet.Configuration/PackageSource/NuGetConstants.cs
Outdated
Show resolved
Hide resolved
test/NuGet.Core.Tests/NuGet.Configuration.Test/PackageSourceProviderTests.cs
Outdated
Show resolved
Hide resolved
bd0da6d
to
3b33e14
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A consideration is simply telling the user when these files are written or overwritten.
That may require piping the ILogger
all the way down from places like RestoreArgs.cs
. But as a user, might I like to know when files are written, at least at certain verbosities?
test/NuGet.Core.Tests/NuGet.Configuration.Test/SettingsTests.cs
Outdated
Show resolved
Hide resolved
test/NuGet.Core.Tests/NuGet.Configuration.Test/SettingsTests.cs
Outdated
Show resolved
Hide resolved
3b33e14
to
abcb5b0
Compare
<configuration> | ||
</configuration>"; | ||
|
||
var nugetConfigPath = "NuGet.Config"; | ||
SettingsTestUtils.CreateConfigurationFile(nugetConfigPath, Path.Combine(mockBaseDirectory, "TestingGlobalPath"), config); | ||
string nugetConfigPath = "NuGet.Config"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Literals should be implicit types
// Settings.LoadSettings' useTestingGlobalPath will use a subdirectory, instead of machine configuration, to allow for testing. | ||
string mockUserProfileDirectory = Path.Combine(mockSolutionDirectory, "TestingGlobalPath"); | ||
|
||
string emptyConfig = @"<?xml version=""1.0"" encoding=""utf-8""?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Literals should be implicit types
File.Exists(nugetConfigPath).Should().BeTrue(); | ||
var actual = SettingsTestUtils.RemoveWhitespace(File.ReadAllText(nugetConfigPath)); | ||
var expected = SettingsTestUtils.RemoveWhitespace(@"<?xml version=""1.0"" encoding=""utf-8""?> | ||
string emptyConfig = @"<?xml version=""1.0"" encoding=""utf-8""?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Literals should be implicit types
|
||
actual.Should().Be(expected); | ||
} | ||
string nugetConfigPath = "NuGet.Config"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Literals should be implicit types
Tip for reviewer: remove the first commit when viewing the diff.
Bug
Fixes: NuGet/Home#11387
Regression? No
Description
PR Checklist
PR has a meaningful title
PR has a linked issue.
Described changes
Tests
Documentation