(#508) Do case insensitive comparison on package ids #3157
Merged
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.
Description Of Changes
This pull request updates the Equals comparisons in the NuGet service to be case insensitive.
This is done as without this change the user will always have to pass in the identifier in the exact casing that is returned from the NuGet server, causing issues especially during upgrade scenarios.
Additionally, Equals and Compare methods has been added to the banned API list to prevent the use
of these without specifying a StringComparison.
Motivation and Context
The behaviour in v2.x and 1.x should behave similar, and we should not expect the user to do the work for us to ensure the casing of installed packages, server packages and passed in identifier to be the same casing
Testing
choco install 7ziP --confirm
choco upgrade 7Zip --noop -r
7zip|22.1|22.1|false
(there may be additional 0 in the versions)choco upgrade 7zIp
choco uninstall 7Zip --confirm
Operating Systems Testing
Change Types Made
Change Checklist
Related Issue