Show every attached scan profile on the project security configuration page

What does this MR do and why?

Show every attached scan profile

List every attached scan profile in its own row on the project security
configuration page. ScanProfileConfiguration builds one table item per
attached profile, so each gets its own preview link, scanner health,
last scan and actions. ScanProfileTable leaves the scanner cell empty
on the later rows of a scan type and drops the border between them, so
the rows of one type read as a group.

Track the profile being disabled, so Disable detaches the clicked
profile instead of the first one of its type, and name that profile in
DisableScanProfileConfirmationModal. Build the rows one scan type at a
time, so the profiles of a type stay adjacent. Rows with zero or one
attached profile render as before.

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

References

Screenshots or screen recordings

Before After
with three SAST profiles attached, only one is shown
624190-before-one-row-per-profile
with three SAST profiles attached, all three are shown
624190-after-one-row-per-profile

How to set up and validate locally

  1. git checkout 624190-show-all-attached-scan-profiles-in-project-configuration
    expand for seed script
    project = Project.find_by_full_path('<group>/<project>')
    %w[first second].each 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)
    end
  2. have a GitLab Ultimate licence

  3. go to the project => Secure => Security configuration

  4. check that the Static application security testing (SAST) scanner has one row per attached profile:

    • each row has its own profile link, Scanner health and Last scan
    • only the first row shows the scanner name
    • there is no divider between rows of the same scanner
  5. check that scanners with one profile or no profile look the same as on master

  6. open the actions menu on the second SAST row => Disable => confirm

    • the confirmation names that profile
    • only that profile should be detached, and the first SAST row should stay

to run tests

yarn jest ee/spec/frontend/security_configuration/components/scan_profiles/scan_profile_configuration_spec.js ee/spec/frontend/security_configuration/components/scan_profiles/disable_scan_profile_confirmation_modal_spec.js spec/frontend/security_configuration/components/scan_profiles/scan_profile_table_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