Skip to content

Commit

Permalink
[Security Solution][Quality Gate Monitoring] Fixed override for monit…
Browse files Browse the repository at this point in the history
…oring pipeline (#196841)

## Summary

Instead of just quality gate for security, a monitoring pipeline has
been introduced which acts like quality gate but is overriding the
kibana image with the latest [dev-devenv
version](https://github.com/elastic/serverless-gitops/blob/79862d97b1b1d3a97c0d8e2091ea06b9aed43f0c/services/kibana/versions.yaml#L4).

This change addresses the changes needed for this new pipeline taking
under consideration the environmental variable
`KIBANA_MKI_QUALITY_GATE_MONITORING` which if present, it defines that
we do run the set of tests for quality gate but with an override.

(cherry picked from commit 6091542)
  • Loading branch information
dkirchan committed Oct 18, 2024
1 parent 10a9161 commit bc3879e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)}`;
Expand Down

0 comments on commit bc3879e

Please sign in to comment.