NuGet symbol package support
🍎 Context
The NuGet package registry allows users to publish and consume NuGet packages with GitLab, specifically the .nupkg
files are the files that are uploaded and downloaded.
There is an additional type of NuGet package called a symbol package which compliments existing packages with debugging information for development. These packages have the file format .snupkg
.
Supporting the uploading of .snupkg
files is exactly what this MR adds.
🔎 What does this MR do?
- Adds one new endpoint to
Api::NugetProjectPackages
to handle symbol package uploads - Updates the NuGet service index to include information about the symbol package upload endpoint in its payload. When clients like Visual Studio and dotnet work with NuGet packages, first they make a request to see what API services are available. By adding this, the clients know they can expect to be able to upload/download symbol packages.
- Updates the NuGet metadata extraction service to determine if an uploaded file is a symbol package or not. When files are uploaded from the NuGet clients, this information is embedded in a file that needs to be extracted and read.
- Adds some new test fixtures for symbol packages
📸 Screenshots (strongly suggested)
Publishing a package that includes a symbol package
I used an existing open source NuGet package to test this, note that if a `.snupkg` file exists, when you push the `.nupkg` file, it is uploaded automatically with it.
$nuget push Prism.Core.8.1.97.nupkg -Source localhost
Pushing Prism.Core.8.1.97.nupkg to 'http://gdk.test:3001/api/v4/projects/22/packages/nuget'...
PUT http://gdk.test:3001/api/v4/projects/22/packages/nuget/
Created http://gdk.test:3001/api/v4/projects/22/packages/nuget/ 1422ms
Your package was pushed.
Pushing Prism.Core.8.1.97.snupkg to 'http://gdk.test:3001/api/v4/projects/22/packages/nuget/symbolpackage'...
PUT http://gdk.test:3001/api/v4/projects/22/packages/nuget/symbolpackage/
Created http://gdk.test:3001/api/v4/projects/22/packages/nuget/symbolpackage/ 12373ms
Your package was pushed.
☑ Does this MR meet the acceptance criteria?
Conformity
-
I have included a changelog entry, or it's not needed. (Does this MR need a changelog?) -
I have added/updated documentation, or it's not needed. (Is documentation required?) -
I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?) -
I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides. -
This change is backwards compatible across updates, or this does not apply.
Availability and Testing
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.) -
I have tested this MR in all supported browsers, or it's not needed. -
I have informed the Infrastructure department of a default or new setting change per definition of done, or it's not needed.
Security
Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Related to #262081 (closed)
Edited by Costel Maxim