Skip to content

Show package processing error message returned from API

Rahul Chanila requested to merge 330515-error-package-status-message into master

What does this MR do and why?

Show package processing error message returned from API

The status_message was added to package GraphQL payload in !134183 (merged)

These need to be displayed in the packages list page in 2 places:

  1. Within the alert
  2. Next to individual errored package.

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

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

Before After
Screenshot_2024-03-08_at_5.18.38_pm Screenshot_2024-03-08_at_5.17.55_pm
Screenshot_2024-03-20_at_11.40.51_am Screenshot_2024-03-20_at_11.40.37_am

How to set up and validate locally

On your rails console bundle exec rails c

  1. Find the project where you want to work with the package registry p = Project.find(<project_id>)
  2. Create a package FactoryBot.create(:npm_package, project: p)
  3. Update the status of the package to ERROR Packages::Package.last.update(status: :error)
  4. Go to the package registry using the sidebar or via the URL <hostname>/<project>/-/packages. Confirm that default error message is shown.
  5. Update the status message of the error package Packages::Package.last.update(status_message: 'custom error message').
  6. Refresh the package registry list page <hostname>/<project>/-/packages. Confirm that custom error message is shown.

Related to #330515 (closed)

Edited by Rahul Chanila

Merge request reports