NuGet metadata doesn't load with long/short version numbers
Summary
When pushing a NuGet package to a GitLab package registry where the version number does not match the pattern M.m.p (such as 1.0 or 1.0.0.0) the package will appear as NuGet.Temporary.Package
at /packages and the package will not be available for use. Very similar to #341655 (closed) but we are not using AWS S3.
Steps to reproduce
Tested on gitlab 14.2.3-ee.0 and 14.3.2-ee.0.
Push a NuGet package with a version number that is either M.m or M.m.p.r (i.e. 1.0 or 1.0.0.0) using nuget push <package.nupkg> -Source <your_packages_uri>.
Example Project
Pending.
What is the current bug behavior?
The package appears as follows at /packages:
The package appears as follows via the API:
{
"id": 277,
"name": "NuGet.Temporary.Package",
"version": "0.0.0-91bff4ff-70e0-40ac-8439-1e801b447c95",
"package_type": "nuget",
"status": "error",
"_links": {
"web_path": "/**removed**/**removed**/-/packages/277",
"delete_api_path": "https://**removed**/api/v4/projects/25/packages/277"
},
"created_at": "2021-10-06T21:51:35.451Z",
"tags": []
}
The log displays the following:
exception.message":"Validation failed: Version is invalid".
What is the expected correct behavior?
The package version should be extracted as-is from the .nupkg file.
Relevant logs and/or screenshots
{"severity":"ERROR","time":"2021-10-06T21:43:18.718Z","correlation_id":"01FHBRZ3RVNXH1M30178W4VPNF","exception.class":"Packages::Nuget::UpdatePackageFromMetadataService::InvalidMetadataError","exception.message":"Validation failed: Version is invalid","exception.backtrace":
See bug behavior above.
Results of GitLab environment info
Package storage is local (default config).