Skip to content

Generate illustrations URLs in the backend

What does this MR do?

The pipelines Security tab shows empty states when it's accessed by unauthenticated or unauthorized users. Those empty states' illustrations' URLs are currently generated in Javascript with the imagePath helper, which doesn't seem to be able to retrieve assets from the CDN.

image

This MR refactors the way those illustrations are retrieved by moving the URLs generation to the backend with the Ruby image_path helper, which should fix this issue.

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

Screenshots

Before After
no_cache_bust cache_bust
Image src does not contain any hash Image src contains content hash

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Yorick Peterse

Merge request reports