Skip to content

Fix complianceFrameworkPolicies query complexity

Nataliia Radina requested to merge 478190-query-complexity-fix into master

What does this MR do and why?

In Edit policies section (!166636 - merged) we have edited policy section to show only policies assigned to framework. Some changes made to the query resulted in "Query has the complexity of 259, which exceeds max complexity of 250" error for non-admin users. This MR aims to fix the problem. It reverts some changes done to query and logic while keeping the styles and still showing only assigned policies.

Fix query complexity

Make sure complianceFrameworkPolicies query complexity is less 250

Changelog: fixed

EE:true

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

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

Before After
Screenshot_2024-10-01_at_16.19.09 Screenshot_2024-10-01_at_16.17.26

How to set up and validate locally

  1. Make sure you have Ultimate or Premium subscription
  2. Go to the compliance center of the top level group (Secure > Compliance center in the right menu)
  3. Go to edit framework which has policies attached
  4. Or create a framework and scope policy to it
  5. Observe policies section
  6. You can try to change query complexity for admin to 250 in this file app/graphql/gitlab_schema.rb to make sure the data is still loaded

Related to #478190 (closed)

Edited by Nataliia Radina

Merge request reports

Loading