Skip to content

Show dependency location count if `occurrenceCount` field is present

What does this MR do and why?

Related #467085 (closed)

Show dependency location count if occurrenceCount field is present, even it's it only 1 location, instead of the path.

We're doing this because (see related issue)

It's not possible to get both the project / location path and the counts in a performant manner, so we've decided to always show the counts even if there is only 1.

This follows Always show project count for group dependency ... (!156200 - merged) • Lorenz van Herwaarden • 17.2 which made a similar change for the project column.

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

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot_2024-06-18_at_09.04.36 Screenshot_2024-06-18_at_09.03.52

How to set up and validate locally

  1. Create a new group
  2. Import https://gitlab.com/gitlab-examples/security/security-reports project in this new group
  3. Import https://gitlab.com/lorenzvanherwaarden/security-reports-with-few-dependencies/ project in this new group (same as project above but with less dependencies)
  4. Run a pipeline on both projects
  5. Go to http://gdk.test:3000/groups/<your-group-name>/-/dependencies
  6. Scroll through dependencies and check the Location column. It should contain rows with _2 locations and 1 location. For both, when you click a dropdown should appear with the list of the location(s) where these dependencies appear.
Edited by Lorenz van Herwaarden

Merge request reports