Skip to content

Exclude authors from valid metadata check for NuGet symbol packages

Summary

In !120100 (merged), we implemented a change that introduced two new required metadata properties, authors and description, for NuGet packages. As a result, we now enforce the presence of these properties in the uploaded metadata file before allowing the publishing of a new NuGet package.

However, this change overlooks a specific case concerning symbol packages (.snupkg). Symbol packages, as described in the Microsoft documentation on symbol package structure, do not include the authors property in their metadata files. Therefore, the current implementation prevents the publishing of symbol packages due to the absence of the authors metadata property.

To address this issue, we need to modify the implementation to allow the publishing of symbol packages without enforcing the presence of the authors metadata property. This adjustment will ensure that symbol packages can be published successfully without any unnecessary validation errors.

Steps to reproduce

  1. Follow the steps outlined in the Microsoft documentation on creating a symbol package to create a new symbol package.
  2. Attempt to push the symbol package to GitLab.com using the documentation on publishing symbol packages to a NuGet repository.
  3. Access the GitLab.com user interface (UI) and navigate to the project's Package Registry page.
  4. Locate the symbol package that was pushed in Step 2.
  5. Observe that an error message is displayed indicating the failure of publishing the symbol package, with the specific error message being "Invalid Package: failed metadata extraction".

Example Project

What is the current bug behavior?

Symbol packages are not published on GitLab.com.

What is the expected correct behavior?

Symbol packages should be published on GitLab.com.

Relevant logs and/or screenshots

Screenshot_2023-06-12_at_12.14.12

Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

The check of authors property existence in this method should be omitted if symbol_package? is true.

Edited by Moaz Khalifa