Skip to content

Commit

Permalink
[8.x] [Security Solution][Serverless Quality Gate] Restoring override…
Browse files Browse the repository at this point in the history
…s functionality (#196536) (#196608)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security Solution][Serverless Quality Gate] Restoring overrides
functionality (#196536)](#196536)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"dkirchan","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-16T20:47:27Z","message":"[Security
Solution][Serverless Quality Gate] Restoring overrides functionality
(#196536)\n\n## Summary\r\n\r\nDue to a bug introduced in a previous PR,
the `override` value was never\r\nusing the
`process.env.KIBANA_MKI_IMAGE_COMMIT` environment variable.\r\n\r\nThe
reason is that in the command line arguments argparse, commit
value\r\nhad the default of `''` so the commit was never null or
undefined.\r\n\r\n```\r\n .option('commit', {\r\n alias: 'c',\r\n type:
'string',\r\n default: '',\r\n })\r\n```\r\n\r\nRestored the check to
see if the string is also
empty.","sha":"cbe5d9a8fb57bf808d69c3ca35c0fefca7ef54e2","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:
SecuritySolution","backport:prev-minor","v8.16.0"],"title":"[Security
Solution][Serverless Quality Gate] Restoring overrides
functionality","number":196536,"url":"https://github.com/elastic/kibana/pull/196536","mergeCommit":{"message":"[Security
Solution][Serverless Quality Gate] Restoring overrides functionality
(#196536)\n\n## Summary\r\n\r\nDue to a bug introduced in a previous PR,
the `override` value was never\r\nusing the
`process.env.KIBANA_MKI_IMAGE_COMMIT` environment variable.\r\n\r\nThe
reason is that in the command line arguments argparse, commit
value\r\nhad the default of `''` so the commit was never null or
undefined.\r\n\r\n```\r\n .option('commit', {\r\n alias: 'c',\r\n type:
'string',\r\n default: '',\r\n })\r\n```\r\n\r\nRestored the check to
see if the string is also
empty.","sha":"cbe5d9a8fb57bf808d69c3ca35c0fefca7ef54e2"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196536","number":196536,"mergeCommit":{"message":"[Security
Solution][Serverless Quality Gate] Restoring overrides functionality
(#196536)\n\n## Summary\r\n\r\nDue to a bug introduced in a previous PR,
the `override` value was never\r\nusing the
`process.env.KIBANA_MKI_IMAGE_COMMIT` environment variable.\r\n\r\nThe
reason is that in the command line arguments argparse, commit
value\r\nhad the default of `''` so the commit was never null or
undefined.\r\n\r\n```\r\n .option('commit', {\r\n alias: 'c',\r\n type:
'string',\r\n default: '',\r\n })\r\n```\r\n\r\nRestored the check to
see if the string is also
empty.","sha":"cbe5d9a8fb57bf808d69c3ca35c0fefca7ef54e2"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: dkirchan <[email protected]>
  • Loading branch information
kibanamachine and dkirchan authored Oct 16, 2024
1 parent 1881936 commit 0e67e61
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class CloudHandler extends ProjectHandler {
// 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;
const override = commit && commit !== '' ? 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}!`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class ProxyHandler extends ProjectHandler {
// 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;
const override = commit && commit !== '' ? 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}!`);
Expand Down

0 comments on commit 0e67e61

Please sign in to comment.