Skip to content

Fix detail page of NuGet package with missing metadata

What does this MR do and why?

There's a ~bug on the detail page of a NuGet package (<base URL>/<group>/<project>/-/packages/<package id>). If optional metadata (license_url, project_url or icon_url) is missing in the package, the page is not loaded:

Screenshot image

This bug is fixed by this MR: The corresponding fields are set to be optional in the GraphQL type Types::Packages::Nuget::MetadatumType and the additional metadata rows are only dislayed if the field exists.

🛠 with at Siemens

/cc @bufferoverflow

Screenshots

Detail page of a NuGet package without projectUrl (source):

Before After
image image

How to set up and validate locally

  1. Create a NuGet package without <projectUrl> tag in the .nuspec file.
  2. Publish NuGet package to package registry of a project (http://localhost:3000/help/user/packages/nuget_repository/index.md#publish-a-nuget-package)
  3. Visit Packages & Registries > Package Registry page of project.
  4. Click on the uploaded NuGet package to view the detail page.

MR acceptance checklist

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

Merge request reports