Skip to content

Commit

Permalink
[Security][Serverless] Removed override when the quality gate runs in…
Browse files Browse the repository at this point in the history
… QA (#192885)

## Summary

An override was used so far when a commit was provided no matter
who/what/where the tests were running.

With this change. the override will not be used when the quality gate
runs in QA. The reason behind this change is that we want to simulate
the customer's behavior, so we will be creating a project with whichever
version is currently deployed in QA.

---------

Co-authored-by: Domenico Andreoli <[email protected]>
  • Loading branch information
dkirchan and cavokz authored Oct 4, 2024
1 parent 381c430 commit 9ce6206
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 9ce6206

Please sign in to comment.