Skip to content

Commit

Permalink
Merge branch 'main' of github.com:elastic/kibana into security-assist…
Browse files Browse the repository at this point in the history
…ant-playground
  • Loading branch information
spong committed May 23, 2023
2 parents a5be762 + 34f21be commit c1ca34f
Show file tree
Hide file tree
Showing 3,938 changed files with 112,361 additions and 67,588 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
23 changes: 20 additions & 3 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ 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
Expand Down Expand Up @@ -76,6 +79,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 @@ -209,7 +227,6 @@ 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.agent.ts
- x-pack/test/fleet_api_integration/config.agent_policy.ts
Expand All @@ -223,7 +240,7 @@ enabled:
- 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 @@ -289,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 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
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)"
]
}
]
}
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
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" \
1 change: 1 addition & 0 deletions .buildkite/scripts/steps/storybooks/build_and_upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const STORYBOOKS = [
'language_documentation_popover',
'unified_search',
'random_sampling',
'text_based_editor',
];

const GITHUB_CONTEXT = 'Build and Publish Storybooks';
Expand Down
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const DEV_PATTERNS = [
...DEV_FILE_PATTERNS.map((file) => `{packages,src,x-pack}/**/${file}`),
'packages/kbn-interpreter/tasks/**/*',
'src/dev/**/*',
'x-pack/{dev-tools,tasks,test,build_chromium}/**/*',
'x-pack/{dev-tools,tasks,test,test_serverless,build_chromium}/**/*',
'x-pack/performance/**/*',
'src/setup_node_env/index.js',
'src/cli/dev.js',
Expand Down Expand Up @@ -602,6 +602,8 @@ module.exports = {
'x-pack/test/ui_capabilities/*/tests/**/*',
'x-pack/test/performance/**/*.ts',
'**/cypress.config.{js,ts}',
'x-pack/test_serverless/**/config*.ts',
'x-pack/test_serverless/*/test_suites/**/*',
],
rules: {
'import/no-default-export': 'off',
Expand Down
Loading

0 comments on commit c1ca34f

Please sign in to comment.