Skip to content

Commit 994d8d7

Browse files
Merge branch 'master' into fix/83420
2 parents daf688d + 749c01d commit 994d8d7

File tree

945 files changed

+25264
-7908
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

945 files changed

+25264
-7908
lines changed

.bazelignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Bazel does not support wildcards like .gitignore
2+
# Issues are opened for to include that feature but not available yet
3+
# https://github.com/bazelbuild/bazel/issues/7093
4+
# https://github.com/bazelbuild/bazel/issues/8106
5+
.ci
6+
.git
7+
.github
8+
.idea
9+
.teamcity
10+
.yarn-local-mirror
11+
bazel-cache
12+
bazel-dist
13+
build
14+
node_modules
15+
target

.bazeliskversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.7.3

.bazelrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Inspired on from https://raw.githubusercontent.com/bazelbuild/rules_nodejs/master/.bazelrc
2+
# Import shared settings first so we can override below
3+
import %workspace%/.bazelrc.common
4+
5+
# Remote cache settings for local env
6+
# build --remote_cache=https://storage.googleapis.com/kibana-bazel-cache
7+
# build --incompatible_remote_results_ignore_disk=true
8+
# build --remote_accept_cached=true
9+
# build --remote_upload_local_results=false

.bazelrc.common

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Inspired on from https://raw.githubusercontent.com/bazelbuild/rules_nodejs/master/common.bazelrc
2+
# Common Bazel settings for JavaScript/NodeJS workspaces
3+
# This rc file is automatically discovered when Bazel is run in this workspace,
4+
# see https://docs.bazel.build/versions/master/guide.html#bazelrc
5+
#
6+
# The full list of Bazel options: https://docs.bazel.build/versions/master/command-line-reference.html
7+
8+
# Cache action outputs on disk so they persist across output_base and bazel shutdown (eg. changing branches)
9+
build --disk_cache=bazel-cache/disk-cache
10+
11+
# Bazel repo cache settings
12+
build --repository_cache=bazel-cache/repository-cache
13+
14+
# Bazel will create symlinks from the workspace directory to output artifacts.
15+
# Build results will be placed in a directory called "bazel-dist/bin"
16+
# This will still create a bazel-out symlink in
17+
# the project directory, which must be excluded from the
18+
# editor's search path.
19+
build --symlink_prefix=bazel-dist/
20+
# To disable the symlinks altogether (including bazel-out) we can use
21+
# build --symlink_prefix=/
22+
# however this makes it harder to find outputs.
23+
24+
# Prevents the creation of bazel-out dir
25+
build --experimental_no_product_name_out_symlink
26+
27+
# Make direct file system calls to create symlink trees
28+
build --experimental_inprocess_symlink_creation
29+
30+
# Incompatible flags to run with
31+
build --incompatible_no_implicit_file_export
32+
build --incompatible_restrict_string_escapes
33+
34+
# Log configs
35+
## different from default
36+
common --color=yes
37+
build --show_task_finish
38+
build --noshow_progress
39+
build --noshow_loading_progress
40+
41+
## enforced default values
42+
build --show_result=1
43+
44+
# Specifies desired output mode for running tests.
45+
# Valid values are
46+
# 'summary' to output only test status summary
47+
# 'errors' to also print test logs for failed tests
48+
# 'all' to print logs for all tests
49+
# 'streamed' to output logs for all tests in real time
50+
# (this will force tests to be executed locally one at a time regardless of --test_strategy value).
51+
test --test_output=errors
52+
53+
# Support for debugging NodeJS tests
54+
# Add the Bazel option `--config=debug` to enable this
55+
# --test_output=streamed
56+
# Stream stdout/stderr output from each test in real-time.
57+
# See https://docs.bazel.build/versions/master/user-manual.html#flag--test_output for more details.
58+
# --test_strategy=exclusive
59+
# Run one test at a time.
60+
# --test_timeout=9999
61+
# Prevent long running tests from timing out
62+
# See https://docs.bazel.build/versions/master/user-manual.html#flag--test_timeout for more details.
63+
# --nocache_test_results
64+
# Always run tests
65+
# --node_options=--inspect-brk
66+
# Pass the --inspect-brk option to all tests which enables the node inspector agent.
67+
# See https://nodejs.org/de/docs/guides/debugging-getting-started/#command-line-options for more details.
68+
# --define=VERBOSE_LOGS=1
69+
# Rules will output verbose logs if the VERBOSE_LOGS environment variable is set. `VERBOSE_LOGS` will be passed to
70+
# `nodejs_binary` and `nodejs_test` via the default value of the `default_env_vars` attribute of those rules.
71+
# --compilation_mode=dbg
72+
# Rules may change their build outputs if the compilation mode is set to dbg. For example,
73+
# mininfiers such as terser may make their output more human readable when this is set. `COMPILATION_MODE` will be passed to
74+
# `nodejs_binary` and `nodejs_test` via the default value of the `default_env_vars` attribute of those rules.
75+
# See https://docs.bazel.build/versions/master/user-manual.html#flag--compilation_mode for more details.
76+
test:debug --test_output=streamed --test_strategy=exclusive --test_timeout=9999 --nocache_test_results --define=VERBOSE_LOGS=1
77+
# Use bazel run with `--config=debug` to turn on the NodeJS inspector agent.
78+
# The node process will break before user code starts and wait for the debugger to connect.
79+
run:debug --define=VERBOSE_LOGS=1 -- --node_options=--inspect-brk
80+
# The following option will change the build output of certain rules such as terser and may not be desirable in all cases
81+
build:debug --compilation_mode=dbg
82+
83+
# Turn off legacy external runfiles
84+
# This prevents accidentally depending on this feature, which Bazel will remove.
85+
build --nolegacy_external_runfiles
86+
run --nolegacy_external_runfiles
87+
test --nolegacy_external_runfiles
88+
89+
# Turn on --incompatible_strict_action_env which was on by default
90+
# in Bazel 0.21.0 but turned off again in 0.22.0. Follow
91+
# https://github.com/bazelbuild/bazel/issues/7026 for more details.
92+
# This flag is needed to so that the bazel cache is not invalidated
93+
# when running bazel via `yarn bazel`.
94+
# See https://github.com/angular/angular/issues/27514.
95+
build --incompatible_strict_action_env
96+
run --incompatible_strict_action_env
97+
test --incompatible_strict_action_env
98+
99+
# Do not build runfile trees by default. If an execution strategy relies on runfile
100+
# symlink tree, the tree is created on-demand. See: https://github.com/bazelbuild/bazel/issues/6627
101+
# and https://github.com/bazelbuild/bazel/commit/03246077f948f2790a83520e7dccc2625650e6df
102+
build --nobuild_runfile_links
103+
104+
# When running `bazel coverage` --instrument_test_targets needs to be set in order to
105+
# collect coverage information from test targets
106+
coverage --instrument_test_targets
107+
108+
# Settings for CI
109+
# Bazel flags for CI are in /src/dev/ci_setup/.bazelrc-ci
110+
111+
# Load any settings specific to the current user.
112+
# .bazelrc.user should appear in .gitignore so that settings are not shared with team members
113+
# This needs to be last statement in this
114+
# config, as the user configuration should be able to overwrite flags from this file.
115+
# See https://docs.bazel.build/versions/master/best-practices.html#bazelrc
116+
# (Note that we use .bazelrc.user so the file appears next to .bazelrc in directory listing,
117+
# rather than user.bazelrc as suggested in the Bazel docs)
118+
try-import %workspace%/.bazelrc.user

.bazelversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4.0.0

.ci/teamcity/tests/test_projects.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ set -euo pipefail
55
source "$(dirname "${0}")/../util.sh"
66

77
checks-reporter-with-killswitch "Test Projects" \
8-
yarn kbn run test --exclude kibana --oss --skip-kibana-plugins
8+
yarn kbn run test --exclude kibana --oss --skip-kibana-plugins --skip-missing

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,14 @@ snapshots.js
3636
# package overrides
3737
/packages/elastic-eslint-config-kibana
3838
/packages/kbn-interpreter/src/common/lib/grammar.js
39+
/packages/kbn-tinymath/src/grammar.js
3940
/packages/kbn-plugin-generator/template
4041
/packages/kbn-pm/dist
4142
/packages/kbn-test/src/functional_test_runner/__tests__/fixtures/
4243
/packages/kbn-test/src/functional_test_runner/lib/config/__tests__/fixtures/
4344
/packages/kbn-ui-framework/dist
4445
/packages/kbn-ui-shared-deps/flot_charts
4546
/packages/kbn-monaco/src/painless/antlr
47+
48+
# Bazel
49+
/bazel-*

.eslintrc.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,32 @@ module.exports = {
11921192
},
11931193
},
11941194

1195+
/**
1196+
* Osquery overrides
1197+
*/
1198+
{
1199+
extends: ['eslint:recommended', 'plugin:react/recommended'],
1200+
plugins: ['react'],
1201+
files: ['x-pack/plugins/osquery/**/*.{js,mjs,ts,tsx}'],
1202+
rules: {
1203+
'arrow-body-style': ['error', 'as-needed'],
1204+
'prefer-arrow-callback': 'error',
1205+
'no-unused-vars': 'off',
1206+
'react/prop-types': 'off',
1207+
},
1208+
},
1209+
{
1210+
// typescript and javascript for front end react performance
1211+
files: ['x-pack/plugins/osquery/public/**/!(*.test).{js,mjs,ts,tsx}'],
1212+
plugins: ['react', 'react-perf'],
1213+
rules: {
1214+
'react-perf/jsx-no-new-object-as-prop': 'error',
1215+
'react-perf/jsx-no-new-array-as-prop': 'error',
1216+
'react-perf/jsx-no-new-function-as-prop': 'error',
1217+
'react/jsx-no-bind': 'error',
1218+
},
1219+
},
1220+
11951221
/**
11961222
* Prettier disables all conflicting rules, listing as last override so it takes precedence
11971223
*/

.github/CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@
99
/x-pack/plugins/discover_enhanced/ @elastic/kibana-app
1010
/x-pack/plugins/lens/ @elastic/kibana-app
1111
/x-pack/plugins/graph/ @elastic/kibana-app
12-
/x-pack/plugins/vis_type_timeseries_enhanced/ @elastic/kibana-app
1312
/src/plugins/advanced_settings/ @elastic/kibana-app
1413
/src/plugins/charts/ @elastic/kibana-app
1514
/src/plugins/discover/ @elastic/kibana-app
16-
/src/plugins/lens_oss/ @elastic/kibana-app
1715
/src/plugins/management/ @elastic/kibana-app
1816
/src/plugins/kibana_legacy/ @elastic/kibana-app
1917
/src/plugins/timelion/ @elastic/kibana-app
@@ -127,7 +125,6 @@
127125
/x-pack/test/functional/es_archives/maps/ @elastic/kibana-gis
128126
/x-pack/test/visual_regression/tests/maps/index.js @elastic/kibana-gis
129127
#CC# /src/plugins/maps_legacy/ @elastic/kibana-gis
130-
#CC# /src/plugins/maps_oss/ @elastic/kibana-gis
131128
#CC# /x-pack/plugins/file_upload @elastic/kibana-gis
132129
#CC# /x-pack/plugins/maps_legacy_licensing @elastic/kibana-gis
133130
/src/plugins/tile_map/ @elastic/kibana-gis
@@ -332,6 +329,9 @@ x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @elastic/kib
332329
# Security Intelligence And Analytics
333330
/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules @elastic/security-intelligence-analytics
334331

332+
# Security Asset Management
333+
/x-pack/plugins/osquery @elastic/security-asset-management
334+
335335
# Design (at the bottom for specificity of SASS files)
336336
**/*.scss @elastic/kibana-design
337337
#CC# /packages/kbn-ui-framework/ @elastic/kibana-design

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,7 @@ report.asciidoc
7676

7777
# Yarn local mirror content
7878
.yarn-local-mirror
79+
80+
# Bazel
81+
/bazel-*
82+
/.bazelrc.user

0 commit comments

Comments
 (0)