Skip to content

Add projects field to compliance frameworks GraphQL type

What does this MR do and why?

Add projects field to complianceFrameworks GraphQL type. This will help in fetching all the projects associated to a compliance framework.

Database

https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/23942/commands/76520

 Limit  (cost=0.85..359.89 rows=100 width=787) (actual time=0.077..0.960 rows=100 loops=1)
   Buffers: shared hit=598
   I/O Timings: read=0.000 write=0.000
   ->  Nested Loop  (cost=0.85..41081.53 rows=11442 width=787) (actual time=0.076..0.947 rows=100 loops=1)
         Buffers: shared hit=598
         I/O Timings: read=0.000 write=0.000
         ->  Index Scan using index_project_compliance_framework_settings_on_framework_id on public.project_compliance_framework_settings  (cost=0.29..1092.67 rows=11442 width=8) (actual time=0.045..0.187 rows=100 loops=1)
               Index Cond: (project_compliance_framework_settings.framework_id = 1920)
               Buffers: shared hit=95
               I/O Timings: read=0.000 write=0.000
         ->  Index Scan using projects_pkey on public.projects  (cost=0.56..3.49 rows=1 width=787) (actual time=0.007..0.007 rows=1 loops=100)
               Index Cond: (projects.id = project_compliance_framework_settings.project_id)
               Buffers: shared hit=503
               I/O Timings: read=0.000 write=0.000

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Ensure you have ultimate license on your GDK.
  2. Open GraphiQL explorer by visiting [GDK_HOST]/-/graphql-explorer
  3. Execute the following query
query {
  namespace(fullPath: "flightjs") {
    complianceFrameworks {
      nodes {
        name,
        color,
        projects {
          nodes {
            id,
            name
          }
        }
      }
    }
  }
}
  1. Verify that the above query produces the expected results.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Closes #430760 (closed)

Edited by Huzaifa Iftikhar

Merge request reports