From f36c984cd8cb966d50505cdd67f7a92a6d5ab106 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Sat, 19 Oct 2024 01:05:27 +1100 Subject: [PATCH] [8.x] [Security Solution][Quality Gate Monitoring] Fixed override for monitoring pipeline (#196841) (#196861) # Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution][Quality Gate Monitoring] Fixed override for monitoring pipeline (#196841)](https://github.com/elastic/kibana/pull/196841) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: dkirchan <55240027+dkirchan@users.noreply.github.com> --- .../project_handler/cloud_project_handler.ts | 10 ++++++++-- .../project_handler/proxy_project_handler.ts | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) 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 00880c054d956..28fea5ed88841 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 @@ -41,9 +41,15 @@ export class CloudHandler extends ProjectHandler { } // 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. + // no kibana image override unless it is running for the daily monitoring. + // The tests will be executed against the commit which is already promoted to QA. + const monitoringQualityGate = + process.env.KIBANA_MKI_QUALITY_GATE_MONITORING && + process.env.KIBANA_MKI_QUALITY_GATE_MONITORING === '1'; const qualityGate = - process.env.KIBANA_MKI_QUALITY_GATE && process.env.KIBANA_MKI_QUALITY_GATE === '1'; + process.env.KIBANA_MKI_QUALITY_GATE && + process.env.KIBANA_MKI_QUALITY_GATE === '1' && + !monitoringQualityGate; const override = commit && commit !== '' ? commit : process.env.KIBANA_MKI_IMAGE_COMMIT; if (override && !qualityGate) { const kibanaOverrideImage = `${override?.substring(0, 12)}`; 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 8cc27919377e7..14d62f80efdfd 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 @@ -41,9 +41,15 @@ export class ProxyHandler extends ProjectHandler { } // 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. + // no kibana image override unless it is running for the daily monitoring. + // The tests will be executed against the commit which is already promoted to QA. + const monitoringQualityGate = + process.env.KIBANA_MKI_QUALITY_GATE_MONITORING && + process.env.KIBANA_MKI_QUALITY_GATE_MONITORING === '1'; const qualityGate = - process.env.KIBANA_MKI_QUALITY_GATE && process.env.KIBANA_MKI_QUALITY_GATE === '1'; + process.env.KIBANA_MKI_QUALITY_GATE && + process.env.KIBANA_MKI_QUALITY_GATE === '1' && + !monitoringQualityGate; const override = commit && commit !== '' ? commit : process.env.KIBANA_MKI_IMAGE_COMMIT; if (override && !qualityGate) { const kibanaOverrideImage = `${override?.substring(0, 12)}`;