Remove the duplicate tool coverage status mapping

What does this MR do and why?

Remove the duplicate tool coverage status mapping

Delete TOOL_STATUS_TO_AGGREGATE_VARIABLES and read the tool coverage
card's all-scanners variables from STATUS_FILTER_TO_VARIABLES instead,
keyed through a new TOOL_STATUS_TO_STATUS_FILTER map. Both objects
held the same four status-to-variable pairs, so a coverage state had
to be declared twice or the card and the search bar would disagree
about what it filters. Only the key translation is left, because the
card names its states SUCCESS and NOT_CONFIGURED where the search bar
says PROTECTED and UNPROTECTED.

References

Screenshots or screen recordings

no visual changes expected

How to set up and validate locally

  1. git checkout 580024-remove-duplicate-status-mapping-in-security-inventory
    echo "Feature.enable(:security_inventory_tool_coverage_card)" | gdk rails c
  2. have a GitLab Ultimate licence
  3. go to a group => Secure => Security inventory
  4. check that the tool coverage card is shown with the scanner dropdown on All scanners

to check the card filters

  1. keep the scanner dropdown on All scanners
  2. click each of the four statuses on the card in turn:
    • Enabled
    • Failed
    • Stale
    • Not enabled
  3. check that each one filters the project list, and that clicking it again clears the filter

to check the search bar filters

  1. with All scanners selected, click a card status
  2. note the project list
  3. clear the card selection, then apply the matching search bar filter from Status
  4. check that the two lists are identical for each pair:
    • card Enabled and Status is Protected
    • card Failed and Status is Needs attention
    • card Stale and Status is Has stale scans
    • card Not enabled and Status is Unprotected

to run tests

yarn jest ee/spec/frontend/security_inventory

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 #580024 (closed)

Edited by Miranda Fluharty

Merge request reports

Loading
Loading