-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[FIX] tool-install: Use restore action config options #44309
[FIX] tool-install: Use restore action config options #44309
Conversation
Should also address #36473 |
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.
I tried this and it didn't seem to fix the issue for tool install
or tool restore
.
Let me know if you want to investigate together.
dotnet tool update dotnet-sos --add-source "c:\Users\***\downloads" --global --ignore-failed-sources
I used the failed source which you had provided.
I would also suggest you add a test like we discussed
@baronfel Do we want to backport this to 8.0 once its good? I believe we should. Probably 8.0.3xx? |
When was the regression introduced? |
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.
Fantastic job figuring the correct changes out and also investigating the tests :)
I have a remaining comment I'd like to hear on before we can merge this. There's also that final test you're working on. But the change itself looks great!
src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallGlobalOrToolPathCommand.cs
Show resolved
Hide resolved
Sometime between .NET 8 RC2 and .NET 7, most likely rc2 |
test/dotnet.Tests/CommandTests/ToolInstallGlobalOrToolPathCommandTests.cs
Outdated
Show resolved
Hide resolved
Ok then I'd say we should backport all the way back to 8.0.1xx so that source build gets it too. |
Thanks a lot! And thanks a lot for all the support. I have also added the tests to check if the flag works correctly (aka, it does not throw when the feeds are invalid and the |
Maybe we can use https://api.nuget.org/v3/invalid.json ? That way we at least have some more influence/knowledge on what goes on with the urlSent from my iPhoneOn Oct 22, 2024, at 4:49 PM, Noah Gilson ***@***.***> wrote:
@nagilson commented on this pull request.
In test/dotnet.Tests/CommandTests/ToolInstallGlobalOrToolPathCommandTests.cs:
@@ -975,6 +989,16 @@ public void SetPermission(string path, string chmodArgument)
{
}
}
+
+ private string _nugetConfigWithInvalidSources = @"{
+<?xml version=""1.0"" encoding=""utf-8""?>
+<configuration>
+ <packageSources>
+ <add key=""nuget"" value=""https://api.nuget.org/v3/index.json"" />
+ <add key=""invalid_source"" value=""https://invalidsource.com/v3/index.json"" />
@dsplaisted Is there a standard feed we can use for testing an invalid source? I couldnt find one. Im not sure I like relying on this website but I dont have anything better unless we have something internal we can use for this.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Yes, that seems like a good idea so that it's a domain we control. |
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.
All of my comments are resolved now, so this should be good to go. while the blazor wasm test failure is not related to your change, it does look like one remaining test is failing.
I would suggest you prioritize this issue above all else because it seems to impact the most customers.
After that, I would backport your changes to release/8.0.1xx. Don't merge that PR until you get tactics approval and then approval after that to confirm the branch and release is open for changes. You can use the bot to create backports: #43607 (comment) Like how I did here. In that linked backport PR is a template to get tactics approval. Youll need to fill that out and do manual testing to verify that the fix worked on 8.0.1xx as well.
After that, youll need to send an email to the .NET Tactics alias with the same information asking for approval and add the label 'servicing-consider.' Definitely reach out to confirm once youve gotten it all written up or if you have questions 😄
By the way, why are we doing all of this... this was broken starting in 8.0 and most people are going to be on 8.0 since its the latest stable and long term support version of .NET. We want them to get this fix because it's important. But because its a stable and already released build, the quality / QA check bar is a lot higher, so we have a process in place for these changes |
b6340f9
to
16d81f8
Compare
Hello. Yes, I pushed a fix recently and it should be passing now on the ci/cd. I am rebasing and squashing the commits to avoid having lots of little commits. |
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.
Let's merge
(and also backport) (this change is going to make a lot of people happy)
/backport to to release/8.0.1xx |
Started backporting to to: https://github.com/dotnet/sdk/actions/runs/11505684487 |
@edvilme an error occurred while backporting to to, please check the run log for details! Error: @edvilme is not a repo collaborator, backporting is not allowed. If you're a collaborator please make sure your dotnet team membership visibility is set to Public on https://github.com/orgs/dotnet/people?query=edvilme |
/backport to to release/8.0.1xx |
Started backporting to to: https://github.com/dotnet/sdk/actions/runs/11506674169 |
@edvilme an error occurred while backporting to to, please check the run log for details! Error: The specified backport target branch to wasn't found in the repo. |
/backport to release/8.0.1xx |
Started backporting to release/8.0.1xx: https://github.com/dotnet/sdk/actions/runs/11507297518 |
@edvilme backporting to release/8.0.1xx failed, the patch most likely resulted in conflicts: $ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: [FIX] tool-install: Use config options
Using index info to reconstruct a base tree...
M eng/dogfood.sh
M src/Cli/dotnet/ToolPackage/IToolPackageDownloader.cs
M src/Cli/dotnet/ToolPackage/ToolPackageDownloader.cs
M src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallGlobalOrToolPathCommand.cs
M src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallLocalCommand.cs
M src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallLocalInstaller.cs
A test/Microsoft.DotNet.Tools.Tests.ComponentMocks/ToolPackageDownloaderMock.cs
A test/dotnet.Tests/CommandTests/ToolInstallGlobalOrToolPathCommandTests.cs
A test/dotnet.Tests/CommandTests/ToolInstallLocalCommandTests.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Tests/dotnet.Tests/CommandTests/ToolInstallLocalCommandTests.cs
Auto-merging src/Tests/dotnet.Tests/CommandTests/ToolInstallGlobalOrToolPathCommandTests.cs
Auto-merging src/Tests/Microsoft.DotNet.Tools.Tests.ComponentMocks/ToolPackageDownloaderMock.cs
CONFLICT (content): Merge conflict in src/Tests/Microsoft.DotNet.Tools.Tests.ComponentMocks/ToolPackageDownloaderMock.cs
Auto-merging src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallLocalInstaller.cs
CONFLICT (content): Merge conflict in src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallLocalInstaller.cs
Auto-merging src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallLocalCommand.cs
CONFLICT (content): Merge conflict in src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallLocalCommand.cs
Auto-merging src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallGlobalOrToolPathCommand.cs
CONFLICT (content): Merge conflict in src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallGlobalOrToolPathCommand.cs
Auto-merging src/Cli/dotnet/ToolPackage/ToolPackageDownloader.cs
CONFLICT (content): Merge conflict in src/Cli/dotnet/ToolPackage/ToolPackageDownloader.cs
Auto-merging src/Cli/dotnet/ToolPackage/IToolPackageDownloader.cs
CONFLICT (content): Merge conflict in src/Cli/dotnet/ToolPackage/IToolPackageDownloader.cs
Auto-merging eng/dogfood.sh
CONFLICT (content): Merge conflict in eng/dogfood.sh
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 [FIX] tool-install: Use config options
Error: The process '/usr/bin/git' failed with exit code 128 Please backport manually! |
@edvilme an error occurred while backporting to release/8.0.1xx, please check the run log for details! Error: git am failed, most likely due to a merge conflict. |
Note: because of very big differences between the branches, this cannot be cherrypicked or backported automatically. |
/backport to release/9.0.1xx |
Started backporting to release/9.0.1xx: https://github.com/dotnet/sdk/actions/runs/11598094603 |
@edvilme backporting to release/9.0.1xx failed, the patch most likely resulted in conflicts: $ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: [FIX] tool-install: Use config options
Using index info to reconstruct a base tree...
M eng/dogfood.sh
M src/Cli/dotnet/ToolPackage/IToolPackageDownloader.cs
M src/Cli/dotnet/ToolPackage/ToolPackageDownloader.cs
M src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallGlobalOrToolPathCommand.cs
M src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallLocalCommand.cs
M test/Microsoft.DotNet.Tools.Tests.ComponentMocks/ToolPackageDownloaderMock.cs
M test/dotnet.Tests/CommandTests/ToolInstallGlobalOrToolPathCommandTests.cs
Falling back to patching base and 3-way merge...
Auto-merging test/dotnet.Tests/CommandTests/ToolInstallGlobalOrToolPathCommandTests.cs
Auto-merging test/Microsoft.DotNet.Tools.Tests.ComponentMocks/ToolPackageDownloaderMock.cs
CONFLICT (content): Merge conflict in test/Microsoft.DotNet.Tools.Tests.ComponentMocks/ToolPackageDownloaderMock.cs
Auto-merging src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallLocalCommand.cs
Auto-merging src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallGlobalOrToolPathCommand.cs
CONFLICT (content): Merge conflict in src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallGlobalOrToolPathCommand.cs
Auto-merging src/Cli/dotnet/ToolPackage/ToolPackageDownloader.cs
CONFLICT (content): Merge conflict in src/Cli/dotnet/ToolPackage/ToolPackageDownloader.cs
Auto-merging src/Cli/dotnet/ToolPackage/IToolPackageDownloader.cs
CONFLICT (content): Merge conflict in src/Cli/dotnet/ToolPackage/IToolPackageDownloader.cs
Auto-merging eng/dogfood.sh
CONFLICT (content): Merge conflict in eng/dogfood.sh
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 [FIX] tool-install: Use config options
Error: The process '/usr/bin/git' failed with exit code 128 Please backport manually! |
@edvilme an error occurred while backporting to release/9.0.1xx, please check the run log for details! Error: git am failed, most likely due to a merge conflict. |
Addresses https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2221478
If user has an invalid
PackageSource
on NuGet.config and attempts to install a tool with the--ignore-failed-sources
attribute, it still outputs an error.RestoreActionConfig
needs to be passed down toNuGetPackageDownloader