Skip to content

Commit

Permalink
Merge branch '7.x' into backport/7.x/pr-95610
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Apr 2, 2021
2 parents c2deb8f + c5b7552 commit fd6ab02
Show file tree
Hide file tree
Showing 226 changed files with 3,302 additions and 1,742 deletions.
5 changes: 4 additions & 1 deletion .bazelignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
.idea
.teamcity
.yarn-local-mirror
/bazel
bazel-bin
bazel-kibana
bazel-out
bazel-testlogs
build
node_modules
target
7 changes: 3 additions & 4 deletions .bazelrc.common
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,16 @@ build --disk_cache=~/.bazel-cache/disk-cache
build --repository_cache=~/.bazel-cache/repository-cache

# Bazel will create symlinks from the workspace directory to output artifacts.
# Build results will be placed in a directory called "bazel/bin"
# Build results will be placed in a directory called "bazel-bin"
# This will still create a bazel-out symlink in
# the project directory, which must be excluded from the
# editor's search path.
build --symlink_prefix=bazel/
# To disable the symlinks altogether (including bazel-out) we can use
# build --symlink_prefix=/
# however this makes it harder to find outputs.

# Prevents the creation of bazel-out dir
build --experimental_no_product_name_out_symlink
# build --experimental_no_product_name_out_symlink

# Make direct file system calls to create symlink trees
build --experimental_inprocess_symlink_creation
Expand Down Expand Up @@ -83,7 +82,7 @@ test:debug --test_output=streamed --test_strategy=exclusive --test_timeout=9999
run:debug --define=VERBOSE_LOGS=1 -- --node_options=--inspect-brk
# The following option will change the build output of certain rules such as terser and may not be desirable in all cases
# It will also output both the repo cache and action cache to a folder inside the repo
build:debug --compilation_mode=dbg --show_result=1 --disk_cache=bazel/disk-cache --repository_cache=bazel/repository-cache
build:debug --compilation_mode=dbg --show_result=1

# Turn off legacy external runfiles
# This prevents accidentally depending on this feature, which Bazel will remove.
Expand Down
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ snapshots.js
/packages/kbn-monaco/src/painless/antlr

# Bazel
/bazel
/bazel-*
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,5 @@ report.asciidoc
.yarn-local-mirror

# Bazel
/bazel
/.bazelrc.user
bazel-*
.bazelrc.user
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
x-pack/plugins/canvas/shareable_runtime/**/*.s+(a|c)ss
build
target
bazel-*
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# other packages builds and need to be included as inputs
exports_files(
[
"tsconfig.base.json",
"tsconfig.json",
"package.json"
],
Expand Down
4 changes: 2 additions & 2 deletions docs/discover/search.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ image::discover/images/read-only-badge.png[Example of Discover's read only acces
==== Save a search
To save the current search:

. Click *Save* in the Kibana toolbar.
. Click *Save* in the toolbar.
. Enter a name for the search and click *Save*.

To import, export, and delete saved searches, open the main menu,
Expand All @@ -119,7 +119,7 @@ then click *Stack Management > Saved Objects*.
==== Open a saved search
To load a saved search into Discover:

. Click *Open* in the Kibana toolbar.
. Click *Open* in the toolbar.
. Select the search you want to open.

If the saved search is associated with a different index pattern than is currently
Expand Down
3 changes: 1 addition & 2 deletions docs/maps/maps-aggregations.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ then accumulates the most relevant documents based on sort order for each entry

To enable top hits:

. Click *Add layer*, then select the *Documents* layer.
. Click *Add layer*, then select the *Top hits per entity* layer.
. Configure *Index pattern* and *Geospatial field*.
. In *Scaling*, select *Show top hits per entity*.
. Set *Entity* to the field that identifies entities in your documents.
This field will be used in the terms aggregation to group your documents into entity buckets.
. Set *Documents per entity* to configure the maximum number of documents accumulated per entity.
Expand Down
5 changes: 3 additions & 2 deletions docs/maps/vector-layer.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ Select the appropriate *Scaling* option for your use case.
* *Limit results to 10000.* The layer displays features from the first `index.max_result_window` documents.
Results exceeding `index.max_result_window` are not displayed.

* *Show top hits per entity.* The layer displays the <<maps-top-hits-aggregation, most relevant documents per entity>>.

* *Show clusters when results exceed 10000.* When results exceed `index.max_result_window`, the layer uses {ref}/search-aggregations-bucket-geotilegrid-aggregation.html[GeoTile grid aggregation] to group your documents into clusters and displays metrics for each cluster. When results are less then `index.max_result_window`, the layer displays features from individual documents.

* *Use vector tiles.* Vector tiles partition your map into 6 to 8 tiles.
Expand All @@ -36,6 +34,9 @@ Tiles exceeding `index.max_result_window` have a visual indicator when there are
*Point to point*:: Aggregated data paths between the source and destination.
The index must contain at least 2 fields mapped as {ref}/geo-point.html[geo_point], source and destination.

*Top hits per entity*:: The layer displays the <<maps-top-hits-aggregation, most relevant documents per entity>>.
The index must contain at least one field mapped as {ref}/geo-point.html[geo_point] or {ref}/geo-shape.html[geo_shape].

*Tracks*:: Create lines from points.
The index must contain at least one field mapped as {ref}/geo-point.html[geo_point].

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"@elastic/apm-rum": "^5.6.1",
"@elastic/apm-rum-react": "^1.2.5",
"@elastic/charts": "26.0.0",
"@elastic/datemath": "link:packages/elastic-datemath",
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath/npm_module",
"@elastic/elasticsearch": "npm:@elastic/[email protected]",
"@elastic/ems-client": "7.12.0",
"@elastic/eui": "31.10.0",
Expand Down Expand Up @@ -438,6 +438,7 @@
"@babel/traverse": "^7.12.12",
"@babel/types": "^7.12.12",
"@bazel/ibazel": "^0.14.0",
"@bazel/typescript": "^3.2.3",
"@cypress/snapshot": "^2.1.7",
"@cypress/webpack-preprocessor": "^5.5.0",
"@elastic/apm-rum": "^5.6.1",
Expand Down
4 changes: 3 additions & 1 deletion packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
# targets so we can build them all at once
filegroup(
name = "build",
srcs = [],
srcs = [
"//packages/elastic-datemath:build"
],
)
3 changes: 2 additions & 1 deletion packages/elastic-datemath/.npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/index.test.js
/jest.config.js
/tsconfig.json
/__tests__
76 changes: 76 additions & 0 deletions packages/elastic-datemath/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")

PKG_BASE_NAME = "elastic-datemath"
PKG_REQUIRE_NAME = "@elastic/datemath"

SOURCE_FILES = [
"src/index.ts",
]

SRCS = SOURCE_FILES

filegroup(
name = "srcs",
srcs = glob(SOURCE_FILES),
)

NPM_MODULE_EXTRA_FILES = [
"package.json",
"README.md",
]

SRC_DEPS = [
"@npm//moment",
]

TYPES_DEPS = [
"@npm//@types/node",
]

DEPS = SRC_DEPS + TYPES_DEPS

ts_config(
name = "tsconfig",
src = "tsconfig.json",
deps = [
"//:tsconfig.base.json",
],
)

ts_project(
name = "tsc",
srcs = SRCS,
deps = DEPS,
declaration = True,
declaration_map = True,
incremental = True,
out_dir = "target",
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig",
)

js_library(
name = PKG_BASE_NAME,
srcs = [],
deps = [":tsc"] + DEPS,
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)

pkg_npm(
name = "npm_module",
srcs = NPM_MODULE_EXTRA_FILES,
deps = [
":%s" % PKG_BASE_NAME,
]
)

filegroup(
name = "build",
srcs = [
":npm_module",
],
visibility = ["//visibility:public"],
)
5 changes: 2 additions & 3 deletions packages/elastic-datemath/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"license": "Apache-2.0",
"main": "./target/index.js",
"types": "./target/index.d.ts",
"scripts": {
"build": "../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build"
"peerDependencies": {
"moment": "^2.24.0"
}
}
4 changes: 2 additions & 2 deletions packages/elastic-datemath/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"outDir": "./target",
"declaration": true,
"declarationMap": true,
"outDir": "target",
"rootDir": "src",
"sourceMap": true,
"sourceRoot": "../../../../packages/elastic-datemath/src",
"types": [
Expand Down
6 changes: 6 additions & 0 deletions packages/kbn-cli-dev-mode/src/dev_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,5 +249,11 @@ export class DevServer {
)
.subscribe(subscriber)
);

// complete state subjects when run$ completes
subscriber.add(() => {
this.phase$.complete();
this.ready$.complete();
});
});
}
1 change: 1 addition & 0 deletions packages/kbn-cli-dev-mode/src/optimizer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ it('is ready when optimizer phase is success or issue and logs in familiar forma
"ready: false",
"<issue>",
"ready: true",
"complete",
]
`);

Expand Down
28 changes: 20 additions & 8 deletions packages/kbn-cli-dev-mode/src/optimizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,26 @@ export class Optimizer {
},
]);

this.run$ = runOptimizer(config).pipe(
logOptimizerState(log, config),
tap(({ state }) => {
this.phase$.next(state.phase);
this.ready$.next(state.phase === 'success' || state.phase === 'issue');
}),
ignoreElements()
);
this.run$ = new Rx.Observable<void>((subscriber) => {
subscriber.add(
runOptimizer(config)
.pipe(
logOptimizerState(log, config),
tap(({ state }) => {
this.phase$.next(state.phase);
this.ready$.next(state.phase === 'success' || state.phase === 'issue');
}),
ignoreElements()
)
.subscribe(subscriber)
);

// complete state subjects when run$ completes
subscriber.add(() => {
this.phase$.complete();
this.ready$.complete();
});
});
}

getPhase$() {
Expand Down
5 changes: 5 additions & 0 deletions packages/kbn-cli-dev-mode/src/watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ export class Watcher {
.pipe(ignoreElements())
.subscribe(subscriber)
);

// complete state subjects when run$ completes
subscriber.add(() => {
this.restart$.complete();
});
});

serverShouldRestart$() {
Expand Down
Loading

0 comments on commit fd6ab02

Please sign in to comment.