Skip to content

Commit

Permalink
Merge branch 'main' into dot-kibana-split-refactor-kibana-migrator
Browse files Browse the repository at this point in the history
  • Loading branch information
gsoldevila committed May 31, 2023
2 parents 6897e52 + 051ac85 commit 76e38b7
Show file tree
Hide file tree
Showing 7,286 changed files with 236,007 additions and 121,179 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
35 changes: 29 additions & 6 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ disabled:
- test/server_integration/config.base.js
- x-pack/test/functional_with_es_ssl/config.base.ts
- x-pack/test/api_integration/config.ts
- x-pack/test/fleet_api_integration/config.base.ts

# QA suites that are run out-of-band
- x-pack/test/stack_functional_integration/configs/config.stack_functional_integration_base.js
Expand All @@ -28,18 +29,20 @@ disabled:
- x-pack/test/defend_workflows_cypress/config.ts
- x-pack/test/defend_workflows_cypress/endpoint_config.ts
- x-pack/test/defend_workflows_cypress/visual_config.ts
- x-pack/plugins/observability_onboarding/e2e/ftr_config_open.ts
- x-pack/plugins/observability_onboarding/e2e/ftr_config_runner.ts
- x-pack/plugins/observability_onboarding/e2e/ftr_config.ts
- x-pack/test/osquery_cypress/cli_config.ts
- x-pack/test/osquery_cypress/config.ts
- x-pack/test/osquery_cypress/visual_config.ts
- x-pack/test/security_solution_cypress/cases_cli_config.ts
- x-pack/test/security_solution_cypress/ccs_config.ts
- x-pack/test/security_solution_cypress/cli_config.ts
- x-pack/test/security_solution_cypress/cli_config_parallel.ts
- x-pack/test/security_solution_cypress/cli_config_investigations_parallel.ts
- x-pack/test/security_solution_cypress/config.firefox.ts
- x-pack/test/security_solution_cypress/config.ts
- x-pack/test/security_solution_cypress/response_ops_cli_config.ts
- x-pack/test/security_solution_cypress/upgrade_config.ts
- x-pack/test/security_solution_cypress/visual_config.ts
- x-pack/test/threat_intelligence_cypress/visual_config.ts
- x-pack/test/threat_intelligence_cypress/cli_config_parallel.ts
- x-pack/test/threat_intelligence_cypress/config.ts
Expand Down Expand Up @@ -75,6 +78,21 @@ disabled:
# Asset Manager configs, in tech preview, will move to enabled after more stability introduced
- x-pack/test/api_integration/apis/asset_manager/config.ts

# Serverless base config files
- x-pack/test_serverless/api_integration/config.base.ts
- x-pack/test_serverless/functional/config.base.ts
- x-pack/test_serverless/shared/config.base.ts

# Serverless configs, currently only for manual tests runs, CI integration planned
- x-pack/test_serverless/api_integration/test_suites/common/config.ts
- x-pack/test_serverless/api_integration/test_suites/observability/config.ts
- x-pack/test_serverless/api_integration/test_suites/search/config.ts
- x-pack/test_serverless/api_integration/test_suites/security/config.ts
- x-pack/test_serverless/functional/test_suites/common/config.ts
- x-pack/test_serverless/functional/test_suites/observability/config.ts
- x-pack/test_serverless/functional/test_suites/search/config.ts
- x-pack/test_serverless/functional/test_suites/security/config.ts

defaultQueue: 'n2-4-spot'
enabled:
- test/accessibility/config.ts
Expand Down Expand Up @@ -150,6 +168,7 @@ enabled:
- x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/config.ts
- x-pack/test/alerting_api_integration/spaces_only/tests/actions/config.ts
- x-pack/test/alerting_api_integration/spaces_only/tests/action_task_params/config.ts
- x-pack/test/alerting_api_integration/observability/config.ts
- x-pack/test/api_integration_basic/config.ts
- x-pack/test/api_integration/config_security_basic.ts
- x-pack/test/api_integration/config_security_trial.ts
Expand Down Expand Up @@ -208,17 +227,20 @@ enabled:
- x-pack/test/detection_engine_api_integration/security_and_spaces/group10/config.ts
- x-pack/test/detection_engine_api_integration/security_and_spaces/rule_execution_logic/config.ts
- x-pack/test/encrypted_saved_objects_api_integration/config.ts
- x-pack/test/endpoint_api_integration_no_ingest/config.ts
- x-pack/test/examples/config.ts
- x-pack/test/fleet_api_integration/config.ts
- x-pack/test/fleet_api_integration/config.agent.ts
- x-pack/test/fleet_api_integration/config.agent_policy.ts
- x-pack/test/fleet_api_integration/config.epm.ts
- x-pack/test/fleet_api_integration/config.fleet.ts
- x-pack/test/fleet_api_integration/config.package_policy.ts
- x-pack/test/fleet_functional/config.ts
- x-pack/test/ftr_apis/security_and_spaces/config.ts
- x-pack/test/functional_basic/apps/ml/permissions/config.ts
- x-pack/test/functional_basic/apps/ml/data_visualizer/group1/config.ts
- x-pack/test/functional_basic/apps/ml/data_visualizer/group2/config.ts
- x-pack/test/functional_basic/apps/ml/data_visualizer/group3/config.ts
- x-pack/test/functional_basic/apps/transform/creation/index_pattern/config.ts
- x-pack/test/functional_basic/apps/transform/start_reset_delete/config.ts
- x-pack/test/functional_basic/apps/transform/actions/config.ts
- x-pack/test/functional_basic/apps/transform/edit_clone/config.ts
- x-pack/test/functional_basic/apps/transform/creation/runtime_mappings_saved_search/config.ts
- x-pack/test/functional_basic/apps/transform/permissions/config.ts
Expand Down Expand Up @@ -284,7 +306,7 @@ enabled:
- x-pack/test/functional/apps/status_page/config.ts
- x-pack/test/functional/apps/transform/creation/index_pattern/config.ts
- x-pack/test/functional/apps/transform/creation/runtime_mappings_saved_search/config.ts
- x-pack/test/functional/apps/transform/start_reset_delete/config.ts
- x-pack/test/functional/apps/transform/actions/config.ts
- x-pack/test/functional/apps/transform/edit_clone/config.ts
- x-pack/test/functional/apps/transform/permissions/config.ts
- x-pack/test/functional/apps/transform/feature_controls/config.ts
Expand All @@ -303,6 +325,7 @@ enabled:
- x-pack/test/monitoring_api_integration/config.ts
- x-pack/test/observability_api_integration/basic/config.ts
- x-pack/test/observability_api_integration/trial/config.ts
- x-pack/test/observability_api_integration/apis/config.ts
- x-pack/test/observability_functional/with_rac_write.config.ts
- x-pack/test/plugin_api_integration/config.ts
- x-pack/test/plugin_functional/config.ts
Expand Down
14 changes: 14 additions & 0 deletions .buildkite/pipelines/on_merge_unsupported_ftrs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,20 @@ steps:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/security_solution_investigations.sh
label: 'Investigations - Security Solution Tests'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
parallelism: 4
retry:
automatic:
- exit_status: '-1'
limit: 3
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/synthetics_plugin.sh
label: 'Synthetics @elastic/synthetics Tests'
agents:
Expand Down
1 change: 1 addition & 0 deletions .buildkite/pipelines/pull_request/defend_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
parallelism: 2
retry:
automatic:
- exit_status: '-1'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
steps:
- command: .buildkite/scripts/steps/functional/observability_onboarding_cypress.sh
label: 'Observability onboarding Cypress Tests'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
parallelism: 2
retry:
automatic:
- exit_status: '-1'
limit: 3
- exit_status: '*'
limit: 1
1 change: 1 addition & 0 deletions .buildkite/pipelines/pull_request/response_ops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
parallelism: 4
retry:
automatic:
- exit_status: '-1'
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/pipelines/pull_request/security_solution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
parallelism: 4
parallelism: 15
retry:
automatic:
- exit_status: '-1'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
steps:
- command: .buildkite/scripts/steps/functional/security_solution_investigations.sh
label: 'Investigations - Security Solution Tests'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
parallelism: 4
retry:
automatic:
- exit_status: '-1'
limit: 3
- exit_status: '*'
limit: 1
51 changes: 51 additions & 0 deletions .buildkite/pull_requests.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,57 @@
"/__snapshots__/",
"\\.test\\.(ts|tsx|js|jsx)"
]
},
{
"repoOwner": "elastic",
"repoName": "kibana",
"pipelineSlug": "kibana-kme-test",

"enabled": true,
"allow_org_users": true,
"allowed_repo_permissions": ["admin", "write"],
"allowed_list": ["barlowm", "renovate[bot]"],
"set_commit_status": true,
"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))",
"skip_ci_labels": [],
"labels": ["kme-test"],
"skip_target_branches": ["6.8", "7.11", "7.12"],
"enable_skippable_commits": true,
"skip_ci_on_only_changed": [
"^dev_docs/",
"^docs/",
"^rfcs/",
"^.ci/.+\\.yml$",
"^.ci/es-snapshots/",
"^.ci/pipeline-library/",
"^.ci/Jenkinsfile_[^/]+$",
"^\\.github/",
"\\.md$",
"\\.mdx$",
"^api_docs/.+\\.devdocs\\.json$",
"^\\.backportrc\\.json$",
"^nav-kibana-dev\\.docnav\\.json$",
"^src/dev/prs/kibana_qa_pr_list\\.json$",
"^\\.buildkite/pull_requests\\.json$"
],
"always_require_ci_on_changed": [
"^docs/developer/plugin-list.asciidoc$",
"^\\.github/CODEOWNERS$",
"/plugins/[^/]+/readme\\.(md|asciidoc)$"
],
"kibana_versions_check": true,
"kibana_build_reuse": true,
"kibana_build_reuse_pipeline_slugs": ["kibana-kme-test", "kibana-on-merge"],
"kibana_build_reuse_regexes": [
"^test/",
"^x-pack/test/",
"/__snapshots__/",
"\\.test\\.(ts|tsx|js|jsx)"
]
}
]
}
3 changes: 3 additions & 0 deletions .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ const uploadPipeline = (pipelineContent: string | object) => {
GITHUB_PR_LABELS.includes('ci:all-cypress-suites')
) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/security_solution.yml'));
pipeline.push(
getPipeline('.buildkite/pipelines/pull_request/security_solution_investigations.yml')
);
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/defend_workflows.yml'));
}

Expand Down
49 changes: 49 additions & 0 deletions .buildkite/scripts/steps/add_gh_labels_to_bk_metadata.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { execSync } from 'child_process';

const parseTarget = process.argv[2] ?? 'BUILDKITE_MESSAGE';
const alsoAnnotate = process.argv[3] ?? false;

const prNumWithinMsgRe = /\(\#(\d+)\)/;
// @ts-expect-error
const firstMatch = (x: string) => x[0].match(prNumWithinMsgRe)[1];
const head = (x: string): string[] => x.split('\n');
const parseInt10 = (x: string) => parseInt(x, 10);
export type PrNumber = string | number;
const fetchLabels = (prNumber: PrNumber) =>
execSync(`gh pr view '${prNumber}' --json labels | jq '.labels[].name'`)
.toString()
.trim()
.split('\n')
.map((x: string) => x.replaceAll('"', ''))
.join(' ');

try {
const labels = pipe(head, firstMatch, parseInt10, fetchLabels)(`${process.env[parseTarget]}`);
execSync(`buildkite-agent meta-data set gh_labels ${labels}`);
if (alsoAnnotate)
execSync(
`buildkite-agent annotate --context 'default' --style 'info' "Github Labels: ${labels}"`
);
} catch (e) {
console.error(
`\n!!! Error fetching Github Labels (stringified): \n${JSON.stringify(e, null, 2)}`
);
}

export {};

function pipe(...fns: any[]) {
return fns.reduce(
(f, g) =>
(...args: any[]) =>
g(f(...args))
);
}
3 changes: 1 addition & 2 deletions .buildkite/scripts/steps/checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export DISABLE_BOOTSTRAP_VALIDATION=false
.buildkite/scripts/bootstrap.sh

.buildkite/scripts/steps/checks/precommit_hook.sh
.buildkite/scripts/steps/checks/packages.sh
.buildkite/scripts/steps/checks/ts_projects.sh
.buildkite/scripts/steps/checks/packages.sh
.buildkite/scripts/steps/checks/bazel_packages.sh
Expand All @@ -22,4 +21,4 @@ export DISABLE_BOOTSTRAP_VALIDATION=false
.buildkite/scripts/steps/checks/test_projects.sh
.buildkite/scripts/steps/checks/test_hardening.sh
.buildkite/scripts/steps/checks/ftr_configs.sh
.buildkite/scripts/steps/checks/saved_objects_compat_changes.sh
.buildkite/scripts/steps/checks/saved_objects_compat_changes.sh
15 changes: 7 additions & 8 deletions .buildkite/scripts/steps/functional/defend_workflows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@

set -euo pipefail

source .buildkite/scripts/common/util.sh

.buildkite/scripts/bootstrap.sh
node scripts/build_kibana_platform_plugins.js
source .buildkite/scripts/steps/functional/common.sh

export JOB=kibana-defend-workflows-cypress
export KIBANA_INSTALL_DIR=${KIBANA_BUILD_LOCATION}

echo "--- Defend Workflows Cypress tests"
Xvfb -screen 0 1680x946x24 :99 &

node scripts/functional_tests \
--debug --bail \
--config x-pack/test/defend_workflows_cypress/cli_config.ts
export DISPLAY=:99

echo "--- Defend Workflows Cypress tests"

yarn --cwd x-pack/plugins/security_solution cypress:dw:run
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -euo pipefail

source .buildkite/scripts/common/util.sh

.buildkite/scripts/bootstrap.sh
.buildkite/scripts/download_build_artifacts.sh

export JOB=kibana-observability-onboarding-cypress

echo "--- Observability onboarding Cypress Tests"

cd "$XPACK_DIR"

node plugins/observability_onboarding/scripts/test/e2e.js \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
10 changes: 6 additions & 4 deletions .buildkite/scripts/steps/functional/response_ops.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ set -euo pipefail
source .buildkite/scripts/steps/functional/common.sh

export JOB=kibana-security-solution-chrome
export KIBANA_INSTALL_DIR=${KIBANA_BUILD_LOCATION}

Xvfb -screen 0 1680x946x24 :99 &

export DISPLAY=:99

echo "--- Response Ops Cypress Tests on Security Solution"

node scripts/functional_tests \
--debug --bail \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
--config x-pack/test/security_solution_cypress/response_ops_cli_config.ts
yarn --cwd x-pack/plugins/security_solution cypress:run:respops
10 changes: 6 additions & 4 deletions .buildkite/scripts/steps/functional/response_ops_cases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ set -euo pipefail
source .buildkite/scripts/steps/functional/common.sh

export JOB=kibana-security-solution-chrome
export KIBANA_INSTALL_DIR=${KIBANA_BUILD_LOCATION}

Xvfb -screen 0 1680x946x24 :99 &

export DISPLAY=:99

echo "--- Response Ops Cases Cypress Tests on Security Solution"

node scripts/functional_tests \
--debug --bail \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
--config x-pack/test/security_solution_cypress/cases_cli_config.ts
yarn --cwd x-pack/plugins/security_solution cypress:run:cases
Loading

0 comments on commit 76e38b7

Please sign in to comment.