Skip to content

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.

  1. The feature flag is enabled for the specific group:
    1. Feature.enable(:security_inventory_dashboard, group)

      # Example: group = Group.find(33) - note: group.find(33) results in flightjs

    2. Visit directly: http://gdk.test:3000/groups/flightjs/-/security/inventory

      2a. If using flightjs you will need to create a subgroup and 2 projects inside that subgroup

    3. Archive at least 1 project

  2. Before this change:
    1. Browse to a subgroup that contains archived projects
    2. Observe that archived project(s) are visible in the project list
  3. After this change:
    1. Follow the same steps
    2. Verify that only active (non-archived) projects are displayed
    3. Archived projects should no longer appear in the subgroup view

References

#571765 (closed)

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 Nicolae Rotaru

Merge request reports

Loading