Skip to content

Add Nuget package authors, description & published to information returned with a package

What does this MR do and why?

Currently, when viewing a list of NuGet packages from a Gitlab Package registry, important package metadata such as authors & description is not returned.

This MR is creating two new columns (authors & description) in the packages_nuget_metadata table. Once a package is uploaded to the GitLab registry, we extract the metadata from the .nuspec file and store them in the database.

That newly added metadata authors & description can be fetched in the following 3 NuGet endpoints:

A new piece of information is also added: the published property which is added to the package's catalogEntry property. This is useful when displaying a list of NuGet packages in visual studio so the developer can see when a package is published.

Screenshots or screen recordings

visual_studio_nuget_manager

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Download Visual Studio.
  2. Create a new .net empty project in Visual Studio.
  3. In the Solution Explorer, right-click on the project or the solution and select "Manage NuGet Packages".
  4. This will open the "NuGet Package Manager" window, which displays the packages installed in the project and allows you to browse and search for new packages.
  5. At the bottom of the "NuGet Package Manager" window, select "Configure Sources" in the "Package source" dropdown menu.
  6. In the opened "Sources" window, click on "Add". This will open a new "Add Package Source" window. Fill in the details of your local GitLab instance as follows:
  1. Publish a new NuGet package.
  2. After successfully publishing the package, go back to Visual Studio's NuGet Package Manager, you should find your published package with the new metadata visible as in the above screenshot.
  3. You can also test using NuGet API and query the 3 endpoints mentioned above (Metadata Service, Version Metadata Service, Search Service)

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 #273532 (closed)

Edited by Moaz Khalifa

Merge request reports