Name the owning group in the bulk scanners drawer

What does this MR do and why?

Name the owning group in the bulk scanners drawer

Show the name of the top-level group that owns a scan profile in the
security inventory bulk scanners drawer, beside the profile name and
on each option in the profile picker.

Take the name from a new rootGroupName the security inventory page
provides, the same way the security configuration page does. Reuse
managedByLabel instead of repeating the GitLab-or-group logic. Leave
the badge off where the cell reads Mixed, because the projects
disagree and no single profile is named.

Related to https://gitlab.com/gitlab-org/gitlab/-/issues/624190
Changelog: changed
EE: true

This is not behind the custom_scan_profiles_ui flag. The drawer is on the security inventory page and is gated by the apply_security_scan_profiles permission.

References

  • related issue: #624190 (closed)
  • picker badge copied from ee/app/assets/javascripts/security_configuration/components/enable_scanners_wizard/select_scanners.vue
  • label reused from ee/app/assets/javascripts/security_configuration/components/scan_profiles/utils.js

Screenshots or screen recordings

Before After
Profile column before-profile-column after-profile-column
Profile picker before-profile-picker after-profile-picker
Profile column, from a subgroup before-profile-column-subgroup after-profile-column-subgroup
Profile picker, from a subgroup before-profile-picker-subgroup after-profile-picker-subgroup

How to set up and validate locally

  1. git checkout 624190-badge-owning-group-in-bulk-scanners-drawer
  2. have a GitLab Ultimate licence
  3. use a user with the apply_security_scan_profiles permission on the root group
  4. go to a group => Secure => Security inventory
  5. select one or more projects, then open the bulk scanners drawer
  6. check the Profile column, beside each profile name:
    • a GitLab-recommended profile shows a GitLab badge
    • every other profile shows the name of the root group
  7. open a Profile cell's picker dropdown, where one scanner has more than one profile
  8. check that every option in the picker carries the same badge as step 5
  9. go to a subgroup of that group => Secure => Security inventory, and repeat
    • the badge should name the root group, not the subgroup

to run tests

yarn jest ee/spec/frontend/security_inventory

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist.

Edited by Miranda Fluharty

Merge request reports

Loading
Loading