Skip to content

Extract npm metadata generation from a presenter

What does this MR do and why?

In order to easily re-use npm metadata generation in multiple places it needs to be extracted from the presenter Packages::Npm::PackagePresenter into a service, this MR converts the presenter into a Packages::Npm::GenerateMetadataService that can be called in other places.

How to set up and validate locally

  1. Have an NPM package published with a couple of versions.
  2. Go to <gitlab_base_url>/api/v4/projects/<project_id>/packages/npm/<package_name_including_scope>
  3. You should find the output of the metadata endpoint as same as what you would find if you are on the master branch.

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

Edited by Moaz Khalifa

Merge request reports