Add project status filter to Security Inventory search bar

What does this MR do and why?

Adds a Status filter token to the group Security Inventory search bar with three options: Needs attention, Has stale scans, and Unprotected. The group Security Configuration page already exposes these three project statuses through its four aggregate cards, and clicking View projects on any card opens a modal filtered to that status. This MR gives users the same filter directly on the Security Inventory page, so they can drill into projects in a given state without leaving the inventory.

The new token config in status_tokens.js plugs into inventory_dashboard_filtered_search_bar.vue. Its selected value maps in onFilter to one of the boolean arguments (hasScanners, hasFailedOrWarning, hasStale) on namespaceSecurityProjects. Those arguments were already declared on the resolver, so this is a frontend-only change. inventory_dashboard.vue forwards the three variables through the Apollo query for both search paths (searchResults and the new-pagination flow) and extends hasSearch so the search query fires when a Status is set. The token is configured with unique: true and OPERATORS_IS, matching the work item Status pattern, so one Status filter is active at a time. It is placed at the top of the token list in the dropdown so it renders as an independent entry above the Security attributes section, not nested under any bold header.

References

Screenshots or screen recordings

Before After
image.png

How to set up and validate locally

  1. Sign in on GDK as a user with read_security_inventory on a group that has projects with mixed scanner states (some with failing or warning scans, some with stale scans, some with no scanners configured).
  2. Navigate to /groups/<group>/-/security/inventory.
  3. Open the search bar dropdown and confirm Status appears as a standalone entry above the Security attributes section header, with no bold Status label above it.
  4. Pick Status = Needs attention and confirm the list narrows to projects with failed or warning scans.
  5. Switch the value to Has stale scans and confirm the list narrows to projects with stale scans.
  6. Switch the value to Unprotected and confirm the list narrows to projects that have no configured scanners.
  7. Remove the token and confirm the full project list returns.
  8. Combine Status = Needs attention with a Tool coverage token (for example Basic SAST = Failed) and confirm both filters apply together.
  9. Combine Status with a plain text search term and confirm results respect both.

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.

Edited by Chen Charnolevsky

Merge request reports

Loading
Loading