Generate illustrations URLs in the backend
- Related issue: #207111 (closed)
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.
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?
- 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
- To experience the report as an unauthenticated user:
- Open a new "incognito" window
- Navigate to the security report in that new window
- To experience the report as an unauthorized user:
- Sign back in as the root user
- Go to Admin Area > Users
- Click on one of the basic users in the list
- Click on Impersonate
- Navigate to the security report
Screenshots
Before | After |
---|---|
![]() |
![]() |
Image src does not contain any hash | Image src contains content hash |
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines - [-] Merge request performance guidelines
-
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Edited by Yorick Peterse