Skip to content

Refactor logic for performance modal to be reused

Alexander Turinske requested to merge 474839-reuse-methods into master

What does this MR do and why?

Refactor logic for performance modal to be reused

  • abstract out logic to utils methods

Changelog: changed

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.

Policy list Policy editor
Screenshot_2024-09-05_at_12.07.41 Screenshot_2024-09-05_at_12.08.14****

How to set up and validate locally

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

  1. Upload a GitLab Ultimate license
  2. Navigate to group => Secure => Policies
  3. Clone this project and link it to your group
  4. Apply the below patch
diff --git a/ee/app/assets/javascripts/security_orchestration/components/utils.js b/ee/app/assets/javascripts/security_orchestration/components/utils.js
index 3971416b8e23..083a8623329d 100644
--- a/ee/app/assets/javascripts/security_orchestration/components/utils.js
+++ b/ee/app/assets/javascripts/security_orchestration/components/utils.js
@@ -201,7 +201,7 @@ export const hasScheduledRule = (policy) => {
 };
 
 export const checkForPerformanceRisk = ({ policy, namespaceType, projectsCount }) => {
-  const PROJECTS_COUNT_PERFORMANCE_LIMIT = 1000;
+  const PROJECTS_COUNT_PERFORMANCE_LIMIT = -1000;
 
   return (
     hasScheduledRule(policy) &&
  1. Select a scan execution policy with a schedule pipeline and delete it
  2. Verify the performance check appears
  3. Select a scan execution policy with a schedule pipeline and edit it
  4. Delete it from the policy editor
  5. Verify the performance check appears
  6. Select other policies that do not meet the above criteria and ensure the performance check does not appear

Related to #474839 (closed)

Edited by Alexander Turinske

Merge request reports

Loading