Skip to content

NuGet symbol package support

Steve Abrams requested to merge 262081-snupkg-nuget into master

🍎 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.
Uploaded symbol package file showing in the package registry Screen_Shot_2021-06-10_at_12.53.36_PM

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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

Merge request reports