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
- issue: Add project status filter to Security Inventory... (#607768 - closed)
- follow-up refactor: Group Security Inventory filter token configs u... (#607770 - closed)
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
How to set up and validate locally
- Sign in on GDK as a user with
read_security_inventoryon a group that has projects with mixed scanner states (some with failing or warning scans, some with stale scans, some with no scanners configured). - Navigate to
/groups/<group>/-/security/inventory. - Open the search bar dropdown and confirm
Statusappears as a standalone entry above the Security attributes section header, with no bold Status label above it. - Pick
Status = Needs attentionand confirm the list narrows to projects with failed or warning scans. - Switch the value to
Has stale scansand confirm the list narrows to projects with stale scans. - Switch the value to
Unprotectedand confirm the list narrows to projects that have no configured scanners. - Remove the token and confirm the full project list returns.
- Combine
Status = Needs attentionwith a Tool coverage token (for exampleBasic SAST = Failed) and confirm both filters apply together. - Combine
Statuswith 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.
