Skip to content
Snippets Groups Projects

Show dependency location count if `occurrenceCount` field is present

Merged Lorenz van Herwaarden requested to merge dependency-list/prefer-location-count-to-path into master

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

Merge train pipeline #1339188941 passed

Merge train pipeline passed for a9b903dd

Merged by Samantha MingSamantha Ming 9 months ago (Jun 19, 2024 3:02pm UTC)

Loading

Pipeline #1339192538 passed

Pipeline passed for 85c5faa4 on master

Test coverage 64.09% from 0 jobs
10 environments impacted.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading