Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into json-diff-for-rule-…
Browse files Browse the repository at this point in the history
…upgrade
  • Loading branch information
nikitaindik committed Dec 7, 2023
2 parents 77f4eea + 8f30fb0 commit da2b4ec
Show file tree
Hide file tree
Showing 1,924 changed files with 62,404 additions and 18,065 deletions.
3 changes: 2 additions & 1 deletion .backportrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"repoName": "kibana",
"targetBranchChoices": [
"main",
"8.12",
"8.11",
"8.10",
"8.9",
Expand Down Expand Up @@ -48,7 +49,7 @@
"backport"
],
"branchLabelMapping": {
"^v8.12.0$": "main",
"^v8.13.0$": "main",
"^v(\\d+).(\\d+).\\d+$": "$1.$2"
},
"autoMerge": true,
Expand Down
2 changes: 2 additions & 0 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ enabled:
- test/functional/apps/kibana_overview/config.ts
- test/functional/apps/management/config.ts
- test/functional/apps/saved_objects_management/config.ts
- test/functional/apps/sharing/config.ts
- test/functional/apps/status_page/config.ts
- test/functional/apps/visualize/group1/config.ts
- test/functional/apps/visualize/group2/config.ts
Expand Down Expand Up @@ -306,6 +307,7 @@ enabled:
- x-pack/test/functional/apps/ml/stack_management_jobs/config.ts
- x-pack/test/functional/apps/monitoring/config.ts
- x-pack/test/functional/apps/observability_log_explorer/config.ts
- x-pack/test/functional/apps/painless_lab/config.ts
- x-pack/test/functional/apps/remote_clusters/config.ts
- x-pack/test/functional/apps/reporting_management/config.ts
- x-pack/test/functional/apps/rollup_job/config.ts
Expand Down
13 changes: 13 additions & 0 deletions .buildkite/pipelines/es_serverless/verify_es_serverless_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,19 @@ steps:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/security_serverless_ai_assistant.sh
label: 'Serverless AI Assistant - Security Solution Cypress Tests'
if: "build.env('SKIP_CYPRESS') != '1' && build.env('SKIP_CYPRESS') != 'true'"
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 60
parallelism: 1
retry:
automatic:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/defend_workflows_serverless.sh
label: 'Defend Workflows Cypress Tests on Serverless'
if: "build.env('SKIP_CYPRESS') != '1' && build.env('SKIP_CYPRESS') != 'true'"
Expand Down
9 changes: 8 additions & 1 deletion .buildkite/pipelines/flaky_tests/groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"key": "cypress/security_serverless_detection_engine",
"name": "[Serverless] Security Solution Detection Engine - Cypress"
},

{
"key": "cypress/security_solution_detection_engine_exceptions",
"name": "Security Solution Detection Engine - Exceptions - Cypress"
Expand All @@ -58,6 +57,14 @@
"key": "cypress/security_serverless_detection_engine_exceptions",
"name": "[Serverless] Security Solution Detection Engine - Exceptions - Cypress"
},
{
"key": "cypress/security_solution_ai_assistant",
"name": "Security Solution AI Assistant - Cypress"
},
{
"key": "cypress/security_serverless_ai_assistant",
"name": "[Serverless] Security Solution AI Assistant - Cypress"
},
{
"key": "cypress/defend_workflows",
"name": "Security Solution Defend Workflows - Cypress"
Expand Down
24 changes: 24 additions & 0 deletions .buildkite/pipelines/on_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,30 @@ steps:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/security_serverless_ai_assistant.sh
label: 'Serverless AI Assistant - Security Solution Cypress Tests'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 60
parallelism: 1
retry:
automatic:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/security_solution_ai_assistant.sh
label: 'AI Assistant - Security Solution Cypress Tests'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 60
parallelism: 1
retry:
automatic:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/security_solution.sh
label: 'Security Solution Cypress Tests'
agents:
Expand Down
26 changes: 25 additions & 1 deletion .buildkite/pipelines/pull_request/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,18 @@ steps:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/security_serverless_ai_assistant.sh
label: 'Serverless AI Assistant - Security Solution Cypress Tests'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 60
parallelism: 1
retry:
automatic:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/security_solution.sh
label: 'Security Solution Cypress Tests'
agents:
Expand Down Expand Up @@ -213,6 +225,18 @@ steps:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/security_solution_ai_assistant.sh
label: 'AI Assistant - Security Solution Cypress Tests'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 60
parallelism: 1
retry:
automatic:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/security_solution_investigations.sh
label: 'Investigations - Security Solution Cypress Tests'
agents:
Expand All @@ -231,7 +255,7 @@ steps:
queue: n2-4-virt
depends_on: build
timeout_in_minutes: 60
parallelism: 10
parallelism: 16
retry:
automatic:
- exit_status: '*'
Expand Down
8 changes: 4 additions & 4 deletions .buildkite/pipelines/pull_request/cypress_burn.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
steps:
- command: .buildkite/scripts/steps/functional/defend_workflows_burn.sh
label: 'Defend Workflows Cypress Tests, burning changed specs'
label: '[Soft fail] Defend Workflows Cypress Tests, burning changed specs'
agents:
queue: n2-4-virt
depends_on: build
Expand All @@ -11,7 +11,7 @@ steps:
automatic: false

- command: .buildkite/scripts/steps/functional/defend_workflows_serverless_burn.sh
label: 'Defend Workflows Cypress Tests on Serverless, burning changed specs'
label: '[Soft fail] Defend Workflows Cypress Tests on Serverless, burning changed specs'
agents:
queue: n2-4-virt
depends_on: build
Expand All @@ -22,7 +22,7 @@ steps:
automatic: false

- command: .buildkite/scripts/steps/functional/security_solution_burn.sh
label: 'Security Solution Cypress tests, burning changed specs'
label: '[Soft fail] Security Solution Cypress tests, burning changed specs'
agents:
queue: n2-4-spot
depends_on: build
Expand All @@ -33,7 +33,7 @@ steps:
soft_fail: true

- command: .buildkite/scripts/steps/functional/osquery_cypress_burn.sh
label: 'Osquery Cypress Tests, burning changed specs'
label: '[Soft fail] Osquery Cypress Tests, burning changed specs'
agents:
queue: n2-4-spot
depends_on: build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,16 @@ steps:
retry:
automatic:
- exit_status: '*'
limit: 1
limit: 1

- command: .buildkite/scripts/pipelines/security_solution_quality_gate/security_solution_cypress/mki_security_solution_cypress.sh cypress:run:qa:serverless:ai_assistant
label: 'Serverless MKI QA AI Assistant - Security Solution Cypress Tests'
agents:
queue: n2-4-spot
# TODO : Revise the timeout when the pipeline will be officially integrated with the quality gate.
timeout_in_minutes: 300
parallelism: 1
retry:
automatic:
- exit_status: '*'
limit: 1
4 changes: 4 additions & 0 deletions .buildkite/pipelines/sonarqube.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

steps:
- label: Placeholder
command: echo "Hello!"
8 changes: 5 additions & 3 deletions .buildkite/pull_requests.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
"commit_status_context": "kibana-ci",
"build_on_commit": true,
"build_on_comment": true,
"trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))",
"always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))",
"build_drafts": false,
"trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))|^\\/ci$",
"always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))|^\\/ci$",
"skip_ci_labels": ["skip-ci", "jenkins-ci"],
"skip_target_branches": ["6.8", "7.11", "7.12"],
"enable_skippable_commits": true,
Expand Down Expand Up @@ -84,7 +85,8 @@
"^\\.backportrc\\.json$",
"^nav-kibana-dev\\.docnav\\.json$",
"^src/dev/prs/kibana_qa_pr_list\\.json$",
"^\\.buildkite/pull_requests\\.json$"
"^\\.buildkite/pull_requests\\.json$",
"^\\.catalog-info\\.yaml$"
],
"always_require_ci_on_changed": [
"^docs/developer/plugin-list.asciidoc$",
Expand Down
31 changes: 31 additions & 0 deletions .buildkite/scripts/common/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,34 @@ npm_install_global() {
download_artifact() {
retry 3 1 timeout 3m buildkite-agent artifact download "$@"
}


vault_get() {
path=$1
field=$2

fullPath="secret/ci/elastic-kibana/$path"
if [[ "$VAULT_ADDR" == *"secrets.elastic.co"* ]]; then
fullPath="secret/kibana-issues/dev/$path"
fi

if [[ -z "${2:-}" ]]; then
retry 5 5 vault read "$fullPath"
else
retry 5 5 vault read -field="$field" "$fullPath"
fi
}

vault_set() {
path=$1
shift
fields=("$@")

fullPath="secret/ci/elastic-kibana/$path"
if [[ "$VAULT_ADDR" == *"secrets.elastic.co"* ]]; then
fullPath="secret/kibana-issues/dev/$path"
fi

# shellcheck disable=SC2068
retry 5 5 vault write "$fullPath" ${fields[@]}
}
48 changes: 24 additions & 24 deletions .buildkite/scripts/lifecycle/pre_command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ echo '--- Setup environment vars'
source .buildkite/scripts/common/env.sh
source .buildkite/scripts/common/setup_node.sh

BUILDKITE_TOKEN="$(retry 5 5 vault read -field=buildkite_token_all_jobs secret/kibana-issues/dev/buildkite-ci)"
BUILDKITE_TOKEN="$(vault_get buildkite-ci buildkite_token_all_jobs)"
export BUILDKITE_TOKEN

echo '--- Install/build buildkite dependencies'
Expand Down Expand Up @@ -77,11 +77,11 @@ EOF
{
CI_STATS_BUILD_ID="$(buildkite-agent meta-data get ci_stats_build_id --default '')"
export CI_STATS_BUILD_ID
CI_STATS_TOKEN="$(retry 5 5 vault read -field=api_token secret/kibana-issues/dev/kibana_ci_stats)"

CI_STATS_TOKEN="$(vault_get kibana_ci_stats api_token)"
export CI_STATS_TOKEN
CI_STATS_HOST="$(retry 5 5 vault read -field=api_host secret/kibana-issues/dev/kibana_ci_stats)"

CI_STATS_HOST="$(vault_get kibana_ci_stats api_host)"
export CI_STATS_HOST

if [[ "$CI_STATS_BUILD_ID" ]]; then
Expand All @@ -97,66 +97,66 @@ EOF
fi
}

GITHUB_TOKEN=$(retry 5 5 vault read -field=github_token secret/kibana-issues/dev/kibanamachine)
GITHUB_TOKEN=$(vault_get kibanamachine github_token)
export GITHUB_TOKEN

KIBANA_CI_GITHUB_TOKEN=$(retry 5 5 vault read -field=github_token secret/kibana-issues/dev/kibana-ci-github)
KIBANA_CI_GITHUB_TOKEN=$(vault_get kibana-ci-github github_token)
export KIBANA_CI_GITHUB_TOKEN

KIBANA_CI_REPORTER_KEY=$(retry 5 5 vault read -field=value secret/kibana-issues/dev/kibanamachine-reporter)
KIBANA_CI_REPORTER_KEY=$(vault_get kibanamachine-reporter value)
export KIBANA_CI_REPORTER_KEY

KIBANA_DOCKER_USERNAME="$(retry 5 5 vault read -field=username secret/kibana-issues/dev/container-registry)"
KIBANA_DOCKER_USERNAME="$(vault_get container-registry username)"
export KIBANA_DOCKER_USERNAME

KIBANA_DOCKER_PASSWORD="$(retry 5 5 vault read -field=password secret/kibana-issues/dev/container-registry)"
KIBANA_DOCKER_PASSWORD="$(vault_get container-registry password)"
export KIBANA_DOCKER_PASSWORD

EC_API_KEY="$(retry 5 5 vault read -field=pr_deploy_api_key secret/kibana-issues/dev/kibana-ci-cloud-deploy)"
EC_API_KEY="$(vault_get kibana-ci-cloud-deploy pr_deploy_api_key)"
export EC_API_KEY

PROJECT_API_KEY="$(retry 5 5 vault read -field=pr_deploy_api_key secret/kibana-issues/dev/kibana-ci-project-deploy)"
PROJECT_API_KEY="$(vault_get kibana-ci-project-deploy pr_deploy_api_key)"
export PROJECT_API_KEY

PROJECT_API_DOMAIN="$(retry 5 5 vault read -field=pr_deploy_domain secret/kibana-issues/dev/kibana-ci-project-deploy)"
PROJECT_API_DOMAIN="$(vault_get kibana-ci-project-deploy pr_deploy_domain)"
export PROJECT_API_DOMAIN

SYNTHETICS_SERVICE_USERNAME="$(retry 5 5 vault read -field=username secret/kibana-issues/dev/kibana-ci-synthetics-credentials)"
SYNTHETICS_SERVICE_USERNAME="$(vault_get kibana-ci-synthetics-credentials username)"
export SYNTHETICS_SERVICE_USERNAME

SYNTHETICS_SERVICE_PASSWORD="$(retry 5 5 vault read -field=password secret/kibana-issues/dev/kibana-ci-synthetics-credentials)"
SYNTHETICS_SERVICE_PASSWORD="$(vault_get kibana-ci-synthetics-credentials password)"
export SYNTHETICS_SERVICE_PASSWORD

SYNTHETICS_SERVICE_MANIFEST="$(retry 5 5 vault read -field=manifest secret/kibana-issues/dev/kibana-ci-synthetics-credentials)"
SYNTHETICS_SERVICE_MANIFEST="$(vault_get kibana-ci-synthetics-credentials manifest)"
export SYNTHETICS_SERVICE_MANIFEST

SYNTHETICS_REMOTE_KIBANA_USERNAME="$(retry 5 5 vault read -field=username secret/kibana-issues/dev/kibana-ci-synthetics-remote-credentials)"
SYNTHETICS_REMOTE_KIBANA_USERNAME="$(vault_get kibana-ci-synthetics-remote-credentials username)"
export SYNTHETICS_REMOTE_KIBANA_USERNAME

SYNTHETICS_REMOTE_KIBANA_PASSWORD="$(retry 5 5 vault read -field=password secret/kibana-issues/dev/kibana-ci-synthetics-remote-credentials)"
SYNTHETICS_REMOTE_KIBANA_PASSWORD="$(vault_get kibana-ci-synthetics-remote-credentials password)"
export SYNTHETICS_REMOTE_KIBANA_PASSWORD

SYNTHETICS_REMOTE_KIBANA_URL=${SYNTHETICS_REMOTE_KIBANA_URL-"$(retry 5 5 vault read -field=url secret/kibana-issues/dev/kibana-ci-synthetics-remote-credentials)"}
SYNTHETICS_REMOTE_KIBANA_URL=${SYNTHETICS_REMOTE_KIBANA_URL-"$(vault_get kibana-ci-synthetics-remote-credentials url)"}
export SYNTHETICS_REMOTE_KIBANA_URL

DEPLOY_TAGGER_SLACK_WEBHOOK_URL=${DEPLOY_TAGGER_SLACK_WEBHOOK_URL:-"$(retry 5 5 vault read -field=DEPLOY_TAGGER_SLACK_WEBHOOK_URL secret/kibana-issues/dev/kibana-serverless-release-tools)"}
DEPLOY_TAGGER_SLACK_WEBHOOK_URL=${DEPLOY_TAGGER_SLACK_WEBHOOK_URL:-"$(vault_get kibana-serverless-release-tools DEPLOY_TAGGER_SLACK_WEBHOOK_URL)"}
export DEPLOY_TAGGER_SLACK_WEBHOOK_URL

# Setup Failed Test Reporter Elasticsearch credentials
{
TEST_FAILURES_ES_CLOUD_ID=$(retry 5 5 vault read -field=cloud_id secret/kibana-issues/dev/failed_tests_reporter_es)
TEST_FAILURES_ES_CLOUD_ID=$(vault_get failed_tests_reporter_es cloud_id)
export TEST_FAILURES_ES_CLOUD_ID

TEST_FAILURES_ES_USERNAME=$(retry 5 5 vault read -field=username secret/kibana-issues/dev/failed_tests_reporter_es)
TEST_FAILURES_ES_USERNAME=$(vault_get failed_tests_reporter_es username)
export TEST_FAILURES_ES_USERNAME

TEST_FAILURES_ES_PASSWORD=$(retry 5 5 vault read -field=password secret/kibana-issues/dev/failed_tests_reporter_es)
TEST_FAILURES_ES_PASSWORD=$(vault_get failed_tests_reporter_es password)
export TEST_FAILURES_ES_PASSWORD
}

BAZEL_LOCAL_DEV_CACHE_CREDENTIALS_FILE="$HOME/.kibana-ci-bazel-remote-cache-local-dev.json"
export BAZEL_LOCAL_DEV_CACHE_CREDENTIALS_FILE
retry 5 5 vault read -field=service_account_json secret/kibana-issues/dev/kibana-ci-bazel-remote-cache-local-dev > "$BAZEL_LOCAL_DEV_CACHE_CREDENTIALS_FILE"
vault_get kibana-ci-bazel-remote-cache-local-dev service_account_json > "$BAZEL_LOCAL_DEV_CACHE_CREDENTIALS_FILE"

PIPELINE_PRE_COMMAND=${PIPELINE_PRE_COMMAND:-".buildkite/scripts/lifecycle/pipelines/$BUILDKITE_PIPELINE_SLUG/pre_command.sh"}
if [[ -f "$PIPELINE_PRE_COMMAND" ]]; then
Expand Down
Loading

0 comments on commit da2b4ec

Please sign in to comment.