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

Enable users to install unlisted version of tool if specify the exact match of the version of the tool #36021

Merged
merged 5 commits into from
Oct 19, 2023

Conversation

JL03-Yue
Copy link
Member

@JL03-Yue JL03-Yue commented Oct 11, 2023

Customer Impact

In .NET 8 we made a breaking change that changes the current .NET tool installation mechanism from restore a local temporary project to downloading the .NET tool from NuGet. This change was introduced because this previous mechanism has number of side effects, often show up as flaky restore errors because MSBuild concepts like Directory.Build.props, or other heirarchical notions, pollute the restore.

The change, however, disable users from installing unlisted tools. Previously, users were able to install unlisted tools per fix in #28951. However, since the mechanism of tool installation are changed, the unlisted tools' downloading are disabled by default. For users, installing unlisted tools are a useful method because it provides clarity and simplicity for those who write tools independently or do not share the tools to the public.

The intended way to fix this is to provide a feature to allow users to install the unlisted version but only if the user specify the exact match, i.e. [version]. (referred to NuGet package version reference). To add this feature, an unlisted parameter is passed to the NuGet API if a exact version is detected. Changes are validated by tests.

Testing
Existing unit tests passed without changes. New tested are added to validate an unlisted tool can be installed with exact version match, and failed to be installed without the version match. The new testing scenarios pass with changes in the pull request.

Risk
Low. This change adds a feature that was missed from breaking change without adding complexity to the behavior.

Original description
Referred to some deprecated global tools get NuGetPackageNotFoundException when installing

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Tools untriaged Request triage from a team member labels Oct 11, 2023
@JL03-Yue JL03-Yue changed the base branch from main to release/8.0.1xx October 11, 2023 20:53
@JL03-Yue JL03-Yue changed the title Add a test for given unlisted tool specified version it can be installed Enable users to install unlisted version of tool if specify the exact match of the version of the tool Oct 12, 2023
@JL03-Yue JL03-Yue requested a review from dsplaisted October 16, 2023 17:46
Copy link
Member

@dsplaisted dsplaisted left a comment

Choose a reason for hiding this comment

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

Looks good!

I have a few comments but I'm marking this as approved since I'll be out tomorrow.

@JL03-Yue
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JL03-Yue JL03-Yue merged commit 1ce5efa into dotnet:release/8.0.1xx Oct 19, 2023
16 checks passed
@JL03-Yue JL03-Yue added the breaking-change Using this label will notify dotnet/compat and trigger a request to file a compat bug label Oct 20, 2023
@ghost
Copy link

ghost commented Oct 20, 2023

Added needs-breaking-change-doc-created label because this PR has the breaking-change label.

When you commit this breaking change:

  1. Create and link to this PR and the issue a matching issue in the dotnet/docs repo using the breaking change documentation template, then remove this needs-breaking-change-doc-created label.
  2. Ask a committer to mail the .NET Breaking Change Notification DL.

Tagging @dotnet/compat for awareness of the breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Tools breaking-change Using this label will notify dotnet/compat and trigger a request to file a compat bug untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants