-
Notifications
You must be signed in to change notification settings - Fork 49
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
Nuget package versions are case insensitive #358
Conversation
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.
Thank you for the contribution.
I'd prefer the first check be implemented with the string compare per my inline comment.
I'm not clear on the need for the second change that constructs the URL.
The comparison of strings per the documentation is case insensitive so there's no need to modify the version itself as any nuget server should be doing a case insensitive comparison.
NuGetVersion uses case insensitive string comparisons for pre-release components. This means that 1.0.0-alpha and 1.0.0-Alpha are equal.
https://learn.microsoft.com/en-us/nuget/concepts/package-versioning
In order for me to accept and merge your contribution you will need to follow the bot's instructions to accept the CLA.
@microsoft-github-policy-service agree company="Microsoft" |
@michelleqyun are you a Microsoft employee? if you associate your github account with the Microsoft organization you should be able to skip the CLA. |
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.
See comments. I had to make the changes to double check that they would work. I pushed them here: https://github.com/microsoft/OSSGadget/tree/pr/358-suggested, along with a new test for case insensitive package names, from which you can git cherry-pick.
Package versions in NuGet are case insensitive, and NuGet's GET package versions API returns a list of all package versions in lowercase. OSSGadget's NuGetProjectManager should lowercase a package version before comparing it against the returned list of package versions.