Skip to content

Commit

Permalink
Merge branch 'master' into exploratry-view
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 committed Apr 2, 2021
2 parents c18c829 + bffded3 commit 99d3596
Show file tree
Hide file tree
Showing 181 changed files with 3,288 additions and 1,319 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
6 changes: 4 additions & 2 deletions .ci/packer_cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

set -e

# cache image used by kibana-load-testing project
docker pull "maven:3.6.3-openjdk-8-slim"
if [[ "$(which docker)" != "" && "$(command uname -m)" != "aarch64" ]]; then
# cache image used by kibana-load-testing project
docker pull "maven:3.6.3-openjdk-8-slim"
fi

./.ci/packer_cache_for_branch.sh master
./.ci/packer_cache_for_branch.sh 7.x
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-*
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,6 @@ report.asciidoc
.yarn-local-mirror

# Bazel
/bazel
/.bazelrc.user
bazel
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
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ readonly links: {
putComponentTemplateMetadata: string;
putSnapshotLifecyclePolicy: string;
putWatch: string;
simulatePipeline: string;
updateTransform: string;
}>;
readonly observability: Record<string, string>;
Expand Down

Large diffs are not rendered by default.

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 @@ -98,7 +98,7 @@
"@elastic/apm-rum": "^5.6.1",
"@elastic/apm-rum-react": "^1.2.5",
"@elastic/charts": "26.1.0",
"@elastic/datemath": "link:packages/elastic-datemath",
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath/npm_module",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.4",
"@elastic/ems-client": "7.12.0",
"@elastic/eui": "31.10.0",
Expand Down Expand Up @@ -441,6 +441,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
Loading

0 comments on commit 99d3596

Please sign in to comment.