Skip to content

Display proper error messages on vulnerabilities fetch failure

What does this MR do?

This improves a vague error message that would be displayed when trying to access a pipeline's security report without having required permissions. We have identified two cases, in both cases we will now show an empty state. The empty state's contents will vary depending on the context:

  1. The user is not logged in: the empty state explains that it is required to be logged in as an authorized user and shows a Sign in button.
  2. The user is logged in but doesn't have permission to see the report: the empty state simply states that the user doesn't have sufficient permissions to view the report.

Screenshots

Before After (Anonynmous user) After (Unauthorized user)
Before Anonynmous user Unauthorized user

How to test this?

  1. Make sure that your GitLab instance contains at least one pipeline with a security report that's accessible at a path similar to /:group/:project/pipelines/:id/security
  2. To experience the report as an unauthenticated user:
    1. Open a new "incognito" window
    2. Navigate to the security report in that new window
  3. To experience the report as an unauthorized user:
    1. Sign back in as the root user
    2. Go to Admin Area > Users
    3. Click on one of the basic users in the list
    4. Click on Impersonate
    5. Navigate to the security report

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Paul Gascou-Vaillancourt

Merge request reports