Skip to content

Remove NU5105, do not warn when a package with a semver2 version is created - #3226

Merged
nkolev92 merged 7 commits into
devfrom
dev-nkolev92-removeNU5105
Feb 18, 2020
Merged

nkolev92 merged 7 commits into
devfrom
dev-nkolev92-removeNU5105

Conversation

@nkolev92

@nkolev92 nkolev92 commented Feb 6, 2020 •

Copy link
Copy Markdown
Member

Bug

Fixes: NuGet/Home#5201
Regression: Yes/No

  • Last working version:
  • How are we preventing it in future:

Fix

Details:
Related to NuGet/NuGetGallery#7836
@joelverhagen perfectly summarized it there. Rephrasing (copying) most of his description.

Note: The nuget.org equivalent work is already being done in NuGet/NuGetGallery#7837, so it'd be nice for both the client and the server make the change around the same time.

When the SemVer 2.0.0 changes were introduced to the V2 and V3 protocol, they are intended to mitigate the impact of SemVer 2.0.0 packages breaking old clients, e.g. suppose a very popular package released a SemVer 2.0.0 version. In such a case a 2.x customer would fail to restore a package because the version parsing would explode. So we make SemVer 2.0.0 packages "opt-in".

This protocol change meant that SemVer 2.0.0 packages were hidden in most of our APIs for clients that predate NuGet version 4.3. 4.3 is when the SemVer 2.0.0 protocol was implemented.
At that time a pack warning was added.

Since 4.3 was shipped so long ago, most clients now support the SemVer 2.0.0 protocol and this warning is more noisy than helpful.

Range Percent Note
≥ 4.3 ~96.4% Supports SemVer 2.0.0 protocol
≥ 3.0 && < 4.3 ~3.6% Partial SemVer 2.0.0 but not SemVer 2.0.0 protocol *
< 3.0 ~0.0% Does not support SemVer 2.0.0

* =

  • Anything before 4.3 will not see SemVer 2.0.0 in search or in the PM UI.
  • 3.5.0 and on supported SemVer 2.0.0 restore in packages.config so people can hand edit to work-around.
  • PackageReference always supported SemVer 2.0.0 from what I can tell so people could hard-code a SemVer 2.0.0 package in their .csproj and still restore.
  • V3 feeds always return SemVer 2.0.0 packages from flat container so packages can be found prior to SemVer 2.0.0. protocol support

The biggest motivation here is that needless warnings often force customers to no warn or in extreme scenario run NoPackageAnalysis=true which renders all of our current/future package quality warning useless.

In this PR, I am removing any reference to the warning itself. I don't see a reason to keep the code around.

Testing/Validation

Tests Added: Yes
Reason for not adding tests:
Validation:

@nkolev92

Copy link
Copy Markdown
Member Author

🔔

@nkolev92
nkolev92 force-pushed the dev-nkolev92-removeNU5105 branch from d23dc38 to 8bac16e Compare February 12, 2020 00:27
@nkolev92
nkolev92 requested a review from zivkan February 12, 2020 00:28
@nkolev92

Copy link
Copy Markdown
Member Author

Had some test failures that should be fixed.
Let me know if anyone wants to review this beside Andy, otherwise I'll merge Tuesday.

@nkolev92
nkolev92 merged commit 16be252 into dev Feb 18, 2020
@nkolev92
nkolev92 deleted the dev-nkolev92-removeNU5105 branch February 18, 2020 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nuget.exe pack should no longer warn about packing a SemVer 2.0.0 package

3 participants