Skip to content

Fix Repository analytics commit statistics failing to render

Alex Pennells requested to merge 429655-fix-blank-graphs into master

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
Screenshot_2024-03-05_at_11.17.02_AM Screenshot_2024-03-05_at_11.17.19_AM

How to set up and validate locally

  1. Navigate to repository analytics for any project (ex. http://gdk.test:3000/gitlab-org/gitlab-shell/-/graphs/main/charts)
  2. Comment out this line to mock a failed permissions check
  3. Validate that the page loads successfully without the Code coverage statistics chart

Related to #429655 (closed)

Merge request reports