Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security][Serverless] Removed override when the quality gate runs in QA #192885

Merged
merged 8 commits into from
Oct 4, 2024

Conversation

dkirchan
Copy link
Contributor

@dkirchan dkirchan commented Sep 13, 2024

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.

@dkirchan dkirchan added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.16.0 Team: Sec Eng Productivity AET Security Engineering Productivity team labels Sep 13, 2024
@dkirchan dkirchan self-assigned this Sep 13, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@dkirchan dkirchan requested a review from pheyos September 13, 2024 14:38
@obltmachine
Copy link

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@dkirchan
Copy link
Contributor Author

/ci

@dkirchan
Copy link
Contributor Author

@pheyos for your visibility after our discussion.

if (process.env.KIBANA_MKI_IMAGE_COMMIT || commit) {
const override = commit ? commit : process.env.KIBANA_MKI_IMAGE_COMMIT;
const qualityGate =
process.env.KIBANA_MKI_QUALITY_GATE && process.env.KIBANA_MKI_QUALITY_GATE !== '1';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, if env KIBANA_MKI_QUALITY_GATE is set to "1" variable qualityGate is set to false. Is this the expected behavior?

if (process.env.KIBANA_MKI_IMAGE_COMMIT || commit) {
const override = commit ? commit : process.env.KIBANA_MKI_IMAGE_COMMIT;
const qualityGate =
process.env.KIBANA_MKI_QUALITY_GATE && process.env.KIBANA_MKI_QUALITY_GATE !== '1';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Copy link
Contributor

@maximpn maximpn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dkirchan,

Could you explain why there is condition process.env.KIBANA_MKI_QUALITY_GATE !== '1'?

On the higher level it'd be nice to refactor the file to read env variables in a centralized way and provide globally available readonly state like

interface Environement {
  readonly name: 'CI' | 'FirstQualityGate' | 'SecondQualityGate'; // we have well defined environments
  readonly imageCommit?: string;
  // ... etc
}

@dkirchan
Copy link
Contributor Author

dkirchan commented Oct 3, 2024

@cavokz Thanks for the fixes.

@dkirchan
Copy link
Contributor Author

dkirchan commented Oct 3, 2024

@maximpn I added a comment before the variable to document the need of it. For now I think this covers the scope of this PR and creating a global state would potentially be a bigger and nice change addressed in another PR. Do you agree?

Copy link
Contributor

@maximpn maximpn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dkirchan Thanks for addressing my comment 🙏

@dkirchan dkirchan enabled auto-merge (squash) October 4, 2024 13:05
@dkirchan dkirchan merged commit 9ce6206 into main Oct 4, 2024
45 of 46 checks passed
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #64 / Reporting Functional Tests with Security enabled Access to Management > Reporting Download report user can access download link for export type that is no longer supported

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @dkirchan

@dkirchan dkirchan deleted the security-remove-override-qa branch October 4, 2024 16:22
jbudz pushed a commit to jbudz/kibana that referenced this pull request Oct 4, 2024
… QA (elastic#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]>
@animehart animehart added backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) and removed backport:skip This commit does not require backporting labels Oct 5, 2024
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11195128783

@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11195128789

@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 5, 2024
… QA (elastic#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]>
(cherry picked from commit 9ce6206)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Oct 5, 2024
…uns in QA (#192885) (#195169)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security][Serverless] Removed override when the quality gate runs in
QA (#192885)](#192885)

<!--- 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-04T16:22:57Z","message":"[Security][Serverless]
Removed override when the quality gate runs in QA (#192885)\n\n##
Summary\r\n\r\nAn override was used so far when a commit was provided no
matter\r\nwho/what/where the tests were running.\r\n\r\nWith this
change. the override will not be used when the quality gate\r\nruns in
QA. The reason behind this change is that we want to simulate\r\nthe
customer's behavior, so we will be creating a project with
whichever\r\nversion is currently deployed in
QA.\r\n\r\n---------\r\n\r\nCo-authored-by: Domenico Andreoli
<[email protected]>","sha":"9ce6206e7e023db27e650a2398841c6a3222f1fb","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","Team: Sec Eng
Productivity"],"title":"[Security][Serverless] Removed override when the
quality gate runs in
QA","number":192885,"url":"https://github.com/elastic/kibana/pull/192885","mergeCommit":{"message":"[Security][Serverless]
Removed override when the quality gate runs in QA (#192885)\n\n##
Summary\r\n\r\nAn override was used so far when a commit was provided no
matter\r\nwho/what/where the tests were running.\r\n\r\nWith this
change. the override will not be used when the quality gate\r\nruns in
QA. The reason behind this change is that we want to simulate\r\nthe
customer's behavior, so we will be creating a project with
whichever\r\nversion is currently deployed in
QA.\r\n\r\n---------\r\n\r\nCo-authored-by: Domenico Andreoli
<[email protected]>","sha":"9ce6206e7e023db27e650a2398841c6a3222f1fb"}},"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/192885","number":192885,"mergeCommit":{"message":"[Security][Serverless]
Removed override when the quality gate runs in QA (#192885)\n\n##
Summary\r\n\r\nAn override was used so far when a commit was provided no
matter\r\nwho/what/where the tests were running.\r\n\r\nWith this
change. the override will not be used when the quality gate\r\nruns in
QA. The reason behind this change is that we want to simulate\r\nthe
customer's behavior, so we will be creating a project with
whichever\r\nversion is currently deployed in
QA.\r\n\r\n---------\r\n\r\nCo-authored-by: Domenico Andreoli
<[email protected]>","sha":"9ce6206e7e023db27e650a2398841c6a3222f1fb"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: dkirchan <[email protected]>
tiansivive pushed a commit to tiansivive/kibana that referenced this pull request Oct 7, 2024
… QA (elastic#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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes Team: Sec Eng Productivity AET Security Engineering Productivity team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants