Skip to content

Remove Packages::Npm::PackagePresenter

What does this MR do and why?

This MR removes Packages::Npm::PackagePresenter since it doesn't bring anything meaningful after Extract npm metadata generation from a presenter (!114450 - merged) was merged and only "converts" a hash to an instance of ruby class.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Create a package

    def fixture_file_upload(*args, **kwargs)
      Rack::Test::UploadedFile.new(*args, **kwargs)
    end
    
    project = FactoryBot.create(:project, :public)
    
    package = FactoryBot.create(:npm_package, project: project, name: "test")
    
    FactoryBot.create(:packages_tag, package: package, name: "my-tag")
  2. Call the updated endpoints to check if everything works correctly.

    Package's metadata endpoint:

    $ curl "http://gdk.test:3000/api/v4/projects/<project-id>/packages/npm/test"

    Package's list tags endpoint:

    $ curl "http://gdk.test:3000/api/v4/projects/<project-id>/packages/npm/-/package/test/dist-tags" 

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

Edited by Dzmitry Meshcharakou

Merge request reports