diff --git a/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/cloud_project_handler.ts b/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/cloud_project_handler.ts index dd1e2c8762909..5ae476c17580e 100644 --- a/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/cloud_project_handler.ts +++ b/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/cloud_project_handler.ts @@ -40,8 +40,12 @@ export class CloudHandler extends ProjectHandler { body.product_types = productTypes; } - if (process.env.KIBANA_MKI_IMAGE_COMMIT || commit) { - const override = commit ? commit : process.env.KIBANA_MKI_IMAGE_COMMIT; + // The qualityGate variable has been added here to ensure that when the quality gate runs, there will be + // no kibana image override. The tests will be executed against the commit which is already promoted to QA. + const qualityGate = + process.env.KIBANA_MKI_QUALITY_GATE && process.env.KIBANA_MKI_QUALITY_GATE === '1'; + const override = commit ?? process.env.KIBANA_MKI_IMAGE_COMMIT; + if (override && !qualityGate) { const kibanaOverrideImage = `${override?.substring(0, 12)}`; this.log.info(`Kibana Image Commit under test: ${process.env.KIBANA_MKI_IMAGE_COMMIT}!`); this.log.info( diff --git a/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/proxy_project_handler.ts b/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/proxy_project_handler.ts index b438849d85b4c..dfc97e9a422d8 100644 --- a/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/proxy_project_handler.ts +++ b/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/proxy_project_handler.ts @@ -40,8 +40,12 @@ export class ProxyHandler extends ProjectHandler { body.product_types = productTypes; } - if (process.env.KIBANA_MKI_IMAGE_COMMIT || commit) { - const override = commit ? commit : process.env.KIBANA_MKI_IMAGE_COMMIT; + // The qualityGate variable has been added here to ensure that when the quality gate runs, there will be + // no kibana image override. The tests will be executed against the commit which is already promoted to QA. + const qualityGate = + process.env.KIBANA_MKI_QUALITY_GATE && process.env.KIBANA_MKI_QUALITY_GATE === '1'; + const override = commit ?? process.env.KIBANA_MKI_IMAGE_COMMIT; + if (override && !qualityGate) { const kibanaOverrideImage = `${override?.substring(0, 12)}`; this.log.info(`Kibana Image Commit under test: ${process.env.KIBANA_MKI_IMAGE_COMMIT}!`); this.log.info(