Hide archived projects from Security Inventory
What does this MR do and why?
Fixes archived projects being incorrectly displayed when browsing subgroups in the Security Inventory.
Changelog: added
EE: true
Problem
When browsing subgroups in the Security Inventory, archived projects were being shown alongside active projects, which is inconsistent with the expected behavior and other parts of the application.
Solution
Added includeArchived: false parameter to the projects query in the Security Inventory GraphQL query to explicitly filter out archived projects.
Changed file:
- ee/app/assets/javascripts/security_inventory/graphql/subgroups_and_projects.query.graphql
Change:
projects(
  first: $projectsFirst
  after: $projectsAfter
  search: $search
  includeSubgroups: $hasSearch
+ includeArchived: false
) {How to test
Prerequisites: An Ultimate license is set up to access security features.
- The feature flag is enabled for the specific group:
- 
Feature.enable(:security_inventory_dashboard, group)# Example: group = Group.find(33)- note:group.find(33)results inflightjs
- 
Visit directly: http://gdk.test:3000/groups/flightjs/-/security/inventory 2a. If using flightjsyou will need to create a subgroup and 2 projects inside that subgroup
- 
Archive at least 1 project 
 
- 
- Before this change:
- Browse to a subgroup that contains archived projects
- Observe that archived project(s) are visible in the project list
 
- After this change:
- Follow the same steps
- Verify that only active (non-archived) projects are displayed
- Archived projects should no longer appear in the subgroup view
 
References
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.