Skip to content

Add Packages::Nuget::Symbol model and corresponding DB table

What does this MR do and why?

In this MR, I create the Packages::Nuget::Symbol model along with the corresponding~database table. This model should hold a reference to the package_packages table, allowing a NuGet package to have multiple symbols. Additionally, the model will be linked to a file on object storage, which will serve as the downloadable symbol file .pdb.


Where those symbol files .pdb are coming from? And how records will be inserted in the packages_nuget_symbols table?

This should happen in a subsequent MR where we are going to implement the symbols indexing service.

When a symbol package .snupkg is pushed to GitLab, it needs to undergo an indexing process. This involves extracting the symbol files .pdb contained within the package compressed file .snupkg and indexing their information. In practical terms, this means creating a record in the packages_nuget_symbols table for each .pdb file found in the .snupkg file. The record should store the relevant details, such as the symbol's signature and file. The signature, extracted from the .pdb file, along with the file name, plays a vital role in matching symbol requests from external clients, such as Visual Studio, to the corresponding .pdb file on the server. By building this index, the symbol server ensures correct symbol lookup and retrieval.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests. Screenshot_2023-08-23_at_11.39.29

How to set up and validate locally

  1. Create a new NuGet package:
def fixture_file_upload(*args, **kwargs)
  Rack::Test::UploadedFile.new(*args, **kwargs)
end

package = FactoryBot.create(:nuget_package, project: Project.first)
  1. Create a new Packages::Nuget::Symbol record:
symbol = FactoryBot.create(:nuget_symbol, package: package)
  1. Verify that the .pdb file has been created:
symbol.file.filename
=> "package.pdb"

symbol.file.object_store
=> 2 # If object storage is enabled locally: https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/howto/object_storage.md

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #416176 (closed)

Edited by Moaz Khalifa

Merge request reports