Skip to content

Commit

Permalink
Merge branch 'main' into fix-transforms-json-display
Browse files Browse the repository at this point in the history
  • Loading branch information
jgowdyelastic authored Jan 9, 2023
2 parents 9066d97 + 5de62a9 commit faa330b
Show file tree
Hide file tree
Showing 5,192 changed files with 99,419 additions and 165,830 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 2 additions & 3 deletions .bazelrc.common
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,11 @@ query --incompatible_no_implicit_file_export
# Log configs
## different from default
common --color=yes
common --show_progress
common --noshow_progress
common --show_task_finish
common --show_progress_rate_limit=10
build --progress_report_interval=10
build --show_loading_progress
build --show_result=1
build --noshow_loading_progress

# Specifies desired output mode for running tests.
# Valid values are
Expand Down
5 changes: 5 additions & 0 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ disabled:
- x-pack/test/fleet_cypress/config.ts
- x-pack/test/fleet_cypress/visual_config.ts
- x-pack/test/functional_enterprise_search/cypress.config.ts
- x-pack/test/defend_workflows_cypress/cli_config.ts
- x-pack/test/defend_workflows_cypress/config.ts
- x-pack/test/defend_workflows_cypress/visual_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 @@ -223,6 +226,7 @@ enabled:
- x-pack/test/licensing_plugin/config.public.ts
- x-pack/test/licensing_plugin/config.ts
- x-pack/test/lists_api_integration/security_and_spaces/config.ts
- 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_functional/with_rac_write.config.ts
Expand Down Expand Up @@ -290,3 +294,4 @@ enabled:
- x-pack/performance/journeys/data_stress_test_lens.ts
- x-pack/performance/journeys/ecommerce_dashboard_saved_search_only.ts
- x-pack/performance/journeys/ecommerce_dashboard_tsvb_gauge_only.ts
- x-pack/performance/journeys/dashboard_listing_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,14 @@ export async function pickTestGroupRunOrder() {
groups: [
{
type: UNIT_TYPE,
defaultMin: 3,
defaultMin: 4,
maxMin: JEST_MAX_MINUTES,
overheadMin: 0.2,
names: jestUnitConfigs,
},
{
type: INTEGRATION_TYPE,
defaultMin: 10,
defaultMin: 60,
maxMin: JEST_MAX_MINUTES,
overheadMin: 0.2,
names: jestIntegrationConfigs,
Expand Down Expand Up @@ -389,7 +389,7 @@ export async function pickTestGroupRunOrder() {
label: 'Jest Tests',
command: getRequiredEnv('JEST_UNIT_SCRIPT'),
parallelism: unit.count,
timeout_in_minutes: 60,
timeout_in_minutes: 120,
key: 'jest',
agents: {
queue: 'n2-4-spot',
Expand All @@ -409,7 +409,7 @@ export async function pickTestGroupRunOrder() {
label: 'Jest Integration Tests',
command: getRequiredEnv('JEST_INTEGRATION_SCRIPT'),
parallelism: integration.count,
timeout_in_minutes: 60,
timeout_in_minutes: 120,
key: 'jest-integration',
agents: {
queue: 'n2-4-spot',
Expand Down
16 changes: 5 additions & 11 deletions .buildkite/pipelines/fleet/packages_daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,15 @@ steps:

- wait

- command: .buildkite/scripts/steps/build_kibana.sh
label: Build Kibana Distribution and Plugins
agents:
queue: c2-16
key: build
if: "build.env('KIBANA_BUILD_ID') == null || build.env('KIBANA_BUILD_ID') == ''"
timeout_in_minutes: 60

- wait

- command: .buildkite/scripts/steps/fleet/install_all_packages.sh
label: Install All Packages
agents:
queue: n2-2
key: linting
env:
# ensure that the FTR logs all output for these tests
DISABLE_CI_LOG_OUTPUT_CAPTURE: 'true'
# disable downloading a kibana build, this step does not use it
KIBANA_BUILD_ID: 'false'
timeout_in_minutes: 90

- wait: ~
Expand Down
15 changes: 15 additions & 0 deletions .buildkite/pipelines/pull_request/defend_workflows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
steps:
- command: .buildkite/scripts/steps/functional/defend_workflows.sh
label: 'Defend Workflows Cypress Tests'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
retry:
automatic:
- exit_status: '-1'
limit: 3
- exit_status: '*'
limit: 1
artifact_paths:
- "target/kibana-security-solution/**/*"
2 changes: 2 additions & 0 deletions .buildkite/pipelines/pull_request/observability_plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
artifact_paths:
- 'x-pack/plugins/observability/e2e/.journeys/**/*'
retry:
automatic:
- exit_status: '-1'
Expand Down
2 changes: 2 additions & 0 deletions .buildkite/pipelines/pull_request/synthetics_plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
artifact_paths:
- 'x-pack/plugins/synthetics/e2e/.journeys/**/*'
retry:
automatic:
- exit_status: '-1'
Expand Down
2 changes: 2 additions & 0 deletions .buildkite/pipelines/pull_request/ux_plugin_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
artifact_paths:
- 'x-pack/plugins/ux/e2e/.journeys/**/*'
retry:
automatic:
- exit_status: '-1'
Expand Down
3 changes: 3 additions & 0 deletions .buildkite/scripts/common/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,6 @@ export BROWSERSLIST_IGNORE_OLD_DATA=true
export TEST_GROUP_TYPE_UNIT="Jest Unit Tests"
export TEST_GROUP_TYPE_INTEGRATION="Jest Integration Tests"
export TEST_GROUP_TYPE_FUNCTIONAL="Functional Tests"

# tells the gh command what our default repo is
export GH_REPO=github.com/elastic/kibana
32 changes: 17 additions & 15 deletions .buildkite/scripts/download_build_artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,27 @@ set -euo pipefail

source "$(dirname "$0")/common/util.sh"

if [[ ! -d "$KIBANA_BUILD_LOCATION/bin" ]]; then
echo '--- Downloading Distribution and Plugin artifacts'
if [[ "${KIBANA_BUILD_ID:-}" != "false" ]]; then
if [[ ! -d "$KIBANA_BUILD_LOCATION/bin" ]]; then
echo '--- Downloading Distribution and Plugin artifacts'

cd "$WORKSPACE"
cd "$WORKSPACE"

download_artifact kibana-default.tar.gz . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}"
download_artifact kibana-default-plugins.tar.gz . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}"
download_artifact kibana-default.tar.gz . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}"
download_artifact kibana-default-plugins.tar.gz . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}"

mkdir -p "$KIBANA_BUILD_LOCATION"
tar -xzf kibana-default.tar.gz -C "$KIBANA_BUILD_LOCATION" --strip=1
mkdir -p "$KIBANA_BUILD_LOCATION"
tar -xzf kibana-default.tar.gz -C "$KIBANA_BUILD_LOCATION" --strip=1

if is_pr_with_label "ci:build-example-plugins"; then
# Testing against an example plugin distribution is not supported,
# mostly due to snapshot failures when testing UI element lists
rm -rf "$KIBANA_BUILD_LOCATION/plugins"
mkdir "$KIBANA_BUILD_LOCATION/plugins"
fi
if is_pr_with_label "ci:build-example-plugins"; then
# Testing against an example plugin distribution is not supported,
# mostly due to snapshot failures when testing UI element lists
rm -rf "$KIBANA_BUILD_LOCATION/plugins"
mkdir "$KIBANA_BUILD_LOCATION/plugins"
fi

cd "$KIBANA_DIR"
cd "$KIBANA_DIR"

tar -xzf ../kibana-default-plugins.tar.gz
tar -xzf ../kibana-default-plugins.tar.gz
fi
fi
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 @@ -66,12 +66,14 @@ const uploadPipeline = (pipelineContent: string | object) => {
/^x-pack\/plugins\/timelines/,
/^x-pack\/plugins\/triggers_actions_ui\/public\/application\/sections\/action_connector_form/,
/^x-pack\/plugins\/triggers_actions_ui\/public\/application\/context\/actions_connectors_context\.tsx/,
/^x-pack\/test\/defend_workflows_cypress/,
/^x-pack\/test\/security_solution_cypress/,
/^fleet_packages\.json/, // It contains reference to prebuilt detection rules, we want to run security solution tests if it changes
])) ||
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/defend_workflows.yml'));
}

if (
Expand Down Expand Up @@ -118,6 +120,7 @@ const uploadPipeline = (pipelineContent: string | object) => {
GITHUB_PR_LABELS.includes('ci:all-cypress-suites')
) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/fleet_cypress.yml'));
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/defend_workflows.yml'));
}

if (
Expand Down
8 changes: 4 additions & 4 deletions .buildkite/scripts/steps/checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ export DISABLE_BOOTSTRAP_VALIDATION=false
.buildkite/scripts/bootstrap.sh

.buildkite/scripts/steps/checks/precommit_hook.sh
.buildkite/scripts/steps/checks/ftr_configs.sh
.buildkite/scripts/steps/checks/ts_projects.sh
.buildkite/scripts/steps/checks/bazel_packages.sh
.buildkite/scripts/steps/checks/verify_notice.sh
.buildkite/scripts/steps/checks/plugin_list_docs.sh
.buildkite/scripts/steps/checks/event_log.sh
.buildkite/scripts/steps/checks/telemetry.sh
.buildkite/scripts/steps/checks/ts_projects.sh
.buildkite/scripts/steps/checks/jest_configs.sh
.buildkite/scripts/steps/checks/plugin_list_docs.sh
.buildkite/scripts/steps/checks/bundle_limits.sh
.buildkite/scripts/steps/checks/i18n.sh
.buildkite/scripts/steps/checks/file_casing.sh
.buildkite/scripts/steps/checks/licenses.sh
.buildkite/scripts/steps/checks/plugins_with_circular_deps.sh
.buildkite/scripts/steps/checks/verify_notice.sh
.buildkite/scripts/steps/checks/test_projects.sh
.buildkite/scripts/steps/checks/test_hardening.sh
.buildkite/scripts/steps/checks/ftr_configs.sh
4 changes: 0 additions & 4 deletions .buildkite/scripts/steps/checks/bazel_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ set -euo pipefail

source .buildkite/scripts/common/util.sh

echo --- Check Bazel Packages Manifest
node scripts/generate packages_build_manifest
check_for_changed_files 'node scripts/generate packages_build_manifest' true

echo --- Check Codeowners Manifest
if [ -f ".github/CODEOWNERS" ]; then
node scripts/generate codeowners
Expand Down
10 changes: 8 additions & 2 deletions .buildkite/scripts/steps/checks/ts_projects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ set -euo pipefail

source .buildkite/scripts/common/util.sh

echo --- Check TypeScript Projects
node scripts/check_ts_projects
echo --- Run TS Project Linter
cmd="node scripts/ts_project_linter"
if is_pr && ! is_auto_commit_disabled; then
cmd="$cmd --fix"
fi

eval "$cmd"
check_for_changed_files "$cmd" true
3 changes: 2 additions & 1 deletion .buildkite/scripts/steps/fleet/install_all_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ source .buildkite/scripts/steps/functional/common.sh
echo '--- Installing all packages'

node scripts/functional_tests \
--debug --bail \
--debug \
--bail \
--config x-pack/test/fleet_packages/config.ts
17 changes: 17 additions & 0 deletions .buildkite/scripts/steps/functional/defend_workflows.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
node scripts/build_kibana_platform_plugins.js

export JOB=kibana-defend-workflows-cypress

echo "--- Defend Workflows Cypress tests"

node scripts/functional_tests \
--debug --bail \
--config x-pack/test/defend_workflows_cypress/cli_config.ts

8 changes: 4 additions & 4 deletions .buildkite/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"incremental": false,
"composite": false,
"emitDeclarationOnly": true,
"outDir": "./target/types",
"outDir": "target/types",
"types": ["node", "mocha"],
"paths": {
"#pipeline-utils": [".buildkite/pipeline-utils/index.ts"],
Expand All @@ -19,5 +16,8 @@
"scripts/**/*",
"pipelines/flaky_tests/groups.json",
"pull_requests.json"
],
"exclude": [
"target/**/*",
]
}
14 changes: 9 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
* Side Public License, v 1.
*/

require('@kbn/babel-register').install();

const Path = require('path');
const Fs = require('fs');

const normalizePath = require('normalize-path');
const { discoverPackageManifestPaths, Jsonc } = require('@kbn/bazel-packages');
const { REPO_ROOT } = require('@kbn/utils');
const { REPO_ROOT } = require('@kbn/repo-info');

const APACHE_2_0_LICENSE_HEADER = `
/*
Expand Down Expand Up @@ -137,6 +139,7 @@ const DEV_DIRECTORIES = [
'__mocks__',
'__stories__',
'e2e',
'cypress',
'fixtures',
'ftr_e2e',
'integration_tests',
Expand Down Expand Up @@ -165,7 +168,7 @@ const DEV_FILE_PATTERNS = [
'mock.{js,ts,tsx}',
'_stubs.{js,ts,tsx}',
'{testHelpers,test_helper,test_utils}.{js,ts,tsx}',
'{postcss,webpack}.config.js',
'{postcss,webpack,cypress}.config.{js,ts}',
];

/** Glob patterns which describe dev-only code. */
Expand All @@ -175,10 +178,10 @@ const DEV_PATTERNS = [
...DEV_FILE_PATTERNS.map((file) => `{packages,src,x-pack}/**/${file}`),
'packages/kbn-interpreter/tasks/**/*',
'src/dev/**/*',
'x-pack/{dev-tools,tasks,scripts,test,build_chromium}/**/*',
'x-pack/plugins/*/server/scripts/**/*',
'x-pack/plugins/fleet/cypress',
'x-pack/{dev-tools,tasks,test,build_chromium}/**/*',
'x-pack/performance/**/*',
'src/setup_node_env/index.js',
'src/cli/dev.js',
];

/** Restricted imports with suggested alternatives */
Expand Down Expand Up @@ -599,6 +602,7 @@ module.exports = {
'x-pack/test/saved_object_api_integration/*/apis/**/*',
'x-pack/test/ui_capabilities/*/tests/**/*',
'x-pack/test/performance/**/*.ts',
'**/cypress.config.{js,ts}',
],
rules: {
'import/no-default-export': 'off',
Expand Down
Loading

0 comments on commit faa330b

Please sign in to comment.