Invalid NuGet packages should fail on upload

Release notes

Have you ever tried to publish a NuGet dependency to GitLab, received a response that it was successful and then were unable to find it in your registry? This occurs because the package upload happens prior to package validation. For example, if you tried to upload a package with an invalid version (1.0.0.0.0.0.1) you would receive a message that the package was published successfully. But since that version is invalid, it later gets rejected.

This issue will resolve that by having Workhorse unpack the nuget.spec file so that we can pass name and metadata on upload and prevent failures due to file size limit or semantic versioning validation. One nice feature of NuGet is that we can pass a custom response back to the client. So unlike other formats, we'll be able to return more helpful error messages.

Problem to solve

I as a C# developer, when I'm publishing a NuGet package, want to know if the package cannot be uploaded due to an invalid SemVer or file size so that I can address the issue prior to moving on to my next task.

Proposal

Workhorse will unpack the nuget.spec file so that we can pass name and metadata on upload and prevent failures due to file size limit or semantic versioning validation.

  • If a package is not valid, Packages should return an error response prior to the upload of the NuGet package.
  • If possible, return a custom response depending on the root cause.