Skip to content

Adds support to filter packages by status

What does this MR do and why?

Adds support to filter packages by status

Adds new package status token

Update package_search to add status query param. I've opened Improve registry search query params generation (!150137 - merged) to cleanup empty query params.

Similar MR: Adds support to filter packages by version (!139403 - merged)

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before After
Screenshot_2024-04-23_at_12.42.27_AM
Screenshot_2024-04-23_at_12.42.36_AM
Screenshot_2024-04-23_at_12.43.10_AM

How to set up and validate locally

  1. On your rails console bundle exec rails c
    1.   def fixture_file_upload(*args, **kwargs)
          Rack::Test::UploadedFile.new(*args, **kwargs)
        end
    2. Find the project where you want to work with the package registry p = Project.find(<project_id>)
    3. Create 25 packages: FactoryBot.create_list(:npm_package, 25, project: p)
    4. Update the status of the package to ERROR Packages::Package.last.update(status: :error)
  2. Go to the package registry using the sidebar or via the URL <hostname>/<project>/-/package
  3. Confirm that filtering by status, filters the results

Related to #451054 (closed)

Edited by Eduardo Sanz García

Merge request reports