Fix Repository analytics commit statistics failing to render
What does this MR do and why?
Fixes a bug where the Commit statistics graphs were failing to render due to the Code coverage permission missing. When the permission is missing js-code-coverage-chart
will not be added to the page, so we can fix by checking it's existence before trying to use it.
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 |
---|---|
How to set up and validate locally
- Navigate to repository analytics for any project (ex. http://gdk.test:3000/gitlab-org/gitlab-shell/-/graphs/main/charts)
- Comment out this line to mock a failed permissions check
- Validate that the page loads successfully without the Code coverage statistics chart
Related to #429655 (closed)