Show every attached scan profile on the group scanner details page

What does this MR do and why?

Show all attached profiles in scanner details

Show every attached scan profile on the group scanner details page.
SourceCell lists each profile as a source. ScannerDetails shows the
worst status, with a count line and popover when the profiles disagree,
and Disable detaches every profile.

Rank statuses with PROFILE_STATUSES_LEAST_TO_MOST_SEVERE, because the
frontend had no order. Move the status icon maps into constants so the
popover reuses them.

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

References

Screenshots or screen recordings

Before After
Table 624190-group-scanner-details-before 624190-group-scanner-details-after
Status popover Not shown 624190-group-scanner-details-status-popover
Sources popover Only the first profile was listed 624190-group-scanner-details-sources-popover

How to set up and validate locally

  1. git checkout 624190-show-all-attached-scan-profiles-in-group-scanner-details
    expand for seed script
    project = Project.find_by_full_path('<group>/<project>')
    first, second = %w[first second].map do |name|
      profile = Security::ScanProfile.create!(
        namespace: project.root_ancestor, scan_type: :sast, name: "SAST #{name}", gitlab_recommended: false
      )
      Security::ScanProfileProject.create!(project: project, scan_profile: profile)
      profile
    end
    Security::ScanProfileProjectStatus.create!(project: project, scan_profile: first, status: :success, last_scan_at: Time.current)
    Security::ScanProfileProjectStatus.create!(project: project, scan_profile: second, status: :not_configured)
  2. have a GitLab Ultimate licence

  3. go to the group => Secure => Security configuration => open the Static application security testing (SAST) scanner's details

  4. find the seeded project's row

  5. check the Source cell:

    • it reads 2 sources with Profile under it
    • hovering it lists SAST first and SAST second, one per line
  6. check the Status cell:

    • it shows the worst status, Not enabled
    • 1 of 2 profiles sits under it, at the same size as the status subtext
    • hovering it lists each profile name beside its status icon and status
  7. check that projects with one profile or no profile look the same as on master

  8. open the seeded project's actions menu => Disable

    • the confirmation names both profiles
    • confirm, and both profiles should be detached from the project

to run tests

yarn jest ee/spec/frontend/security_configuration/components/scan_profiles/scanner_details_spec.js ee/spec/frontend/security_configuration/components/scan_profiles/source_cell_spec.js ee/spec/frontend/security_configuration/components/scan_profiles/scanner_status_icon_spec.js

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #624190 (closed)

Edited by Miranda Fluharty

Merge request reports

Loading
Loading