Skip to content

Commit

Permalink
Merge branch 'master' into lens/fix-advanced-options-error
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine committed Jun 7, 2021
2 parents 46851e8 + 827442b commit 39dfd5f
Show file tree
Hide file tree
Showing 463 changed files with 18,181 additions and 10,733 deletions.
50 changes: 25 additions & 25 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
# Client Side Monitoring / Uptime (lives in APM directories but owned by Uptime)
/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm @elastic/uptime
/x-pack/plugins/apm/e2e/cypress/integration/csm_dashboard.feature @elastic/uptime
/x-pack/plugins/apm/public/application/csmApp.tsx @elastic/uptime
/x-pack/plugins/apm/public/application/uxApp.tsx @elastic/uptime
/x-pack/plugins/apm/public/components/app/RumDashboard @elastic/uptime
/x-pack/plugins/apm/server/lib/rum_client @elastic/uptime
/x-pack/plugins/apm/server/routes/rum_client.ts @elastic/uptime
Expand Down Expand Up @@ -128,7 +128,7 @@
/x-pack/test/functional_basic/apps/ml/ @elastic/ml-ui
/x-pack/test/functional_with_es_ssl/apps/ml/ @elastic/ml-ui

# ML team owns and maintains the transform plugin despite it living in the Elasticsearch management section.
# ML team owns and maintains the transform plugin despite it living in the Data management section.
/x-pack/plugins/transform/ @elastic/ml-ui
/x-pack/test/accessibility/apps/transform.ts @elastic/ml-ui
/x-pack/test/api_integration/apis/transform/ @elastic/ml-ui
Expand Down Expand Up @@ -305,29 +305,29 @@
/x-pack/plugins/enterprise_search/server/collectors/workplace_search/ @elastic/workplace-search-frontend
/x-pack/plugins/enterprise_search/server/saved_objects/workplace_search/ @elastic/workplace-search-frontend

# Elasticsearch UI
/src/plugins/dev_tools/ @elastic/es-ui
/src/plugins/console/ @elastic/es-ui
/src/plugins/es_ui_shared/ @elastic/es-ui
/x-pack/plugins/cross_cluster_replication/ @elastic/es-ui
/x-pack/plugins/index_lifecycle_management/ @elastic/es-ui
/x-pack/plugins/console_extensions/ @elastic/es-ui
/x-pack/plugins/grokdebugger/ @elastic/es-ui
/x-pack/plugins/index_management/ @elastic/es-ui
/x-pack/plugins/license_api_guard/ @elastic/es-ui
/x-pack/plugins/license_management/ @elastic/es-ui
/x-pack/plugins/painless_lab/ @elastic/es-ui
/x-pack/plugins/remote_clusters/ @elastic/es-ui
/x-pack/plugins/rollup/ @elastic/es-ui
/x-pack/plugins/searchprofiler/ @elastic/es-ui
/x-pack/plugins/snapshot_restore/ @elastic/es-ui
/x-pack/plugins/upgrade_assistant/ @elastic/es-ui
/x-pack/plugins/watcher/ @elastic/es-ui
/x-pack/plugins/ingest_pipelines/ @elastic/es-ui
/packages/kbn-ace/ @elastic/es-ui
/packages/kbn-monaco/ @elastic/es-ui
#CC# /x-pack/plugins/console_extensions/ @elastic/es-ui
#CC# /x-pack/plugins/cross_cluster_replication/ @elastic/es-ui
# Stack Management
/src/plugins/dev_tools/ @elastic/kibana-stack-management
/src/plugins/console/ @elastic/kibana-stack-management
/src/plugins/es_ui_shared/ @elastic/kibana-stack-management
/x-pack/plugins/cross_cluster_replication/ @elastic/kibana-stack-management
/x-pack/plugins/index_lifecycle_management/ @elastic/kibana-stack-management
/x-pack/plugins/console_extensions/ @elastic/kibana-stack-management
/x-pack/plugins/grokdebugger/ @elastic/kibana-stack-management
/x-pack/plugins/index_management/ @elastic/kibana-stack-management
/x-pack/plugins/license_api_guard/ @elastic/kibana-stack-management
/x-pack/plugins/license_management/ @elastic/kibana-stack-management
/x-pack/plugins/painless_lab/ @elastic/kibana-stack-management
/x-pack/plugins/remote_clusters/ @elastic/kibana-stack-management
/x-pack/plugins/rollup/ @elastic/kibana-stack-management
/x-pack/plugins/searchprofiler/ @elastic/kibana-stack-management
/x-pack/plugins/snapshot_restore/ @elastic/kibana-stack-management
/x-pack/plugins/upgrade_assistant/ @elastic/kibana-stack-management
/x-pack/plugins/watcher/ @elastic/kibana-stack-management
/x-pack/plugins/ingest_pipelines/ @elastic/kibana-stack-management
/packages/kbn-ace/ @elastic/kibana-stack-management
/packages/kbn-monaco/ @elastic/kibana-stack-management
#CC# /x-pack/plugins/console_extensions/ @elastic/kibana-stack-management
#CC# /x-pack/plugins/cross_cluster_replication/ @elastic/kibana-stack-management

# Security Solution
/x-pack/test/endpoint_api_integration_no_ingest/ @elastic/security-solution
Expand Down
6 changes: 3 additions & 3 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Fetch Node.js rules
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "10f534e1c80f795cffe1f2822becd4897754d18564612510c59b3c73544ae7c6",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.5.0/rules_nodejs-3.5.0.tar.gz"],
sha256 = "4a5d654a4ccd4a4c24eca5d319d85a88a650edf119601550c95bf400c8cc897e",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.5.1/rules_nodejs-3.5.1.tar.gz"],
)

# Now that we have the rules let's import from them to complete the work
load("@build_bazel_rules_nodejs//:index.bzl", "check_rules_nodejs_version", "node_repositories", "yarn_install")

# Assure we have at least a given rules_nodejs version
check_rules_nodejs_version(minimum_version_string = "3.5.0")
check_rules_nodejs_version(minimum_version_string = "3.5.1")

# Setup the Node.js toolchain for the architectures we want to support
#
Expand Down
13 changes: 7 additions & 6 deletions dev_docs/tutorials/expressions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,24 @@ tags: ['kibana', 'onboarding', 'dev', 'architecture']

## Expressions service

Expression service exposes a registry of reusable functions primary used for fetching and transposing data and a registry of renderer functions that can render data into a DOM element.
Adding functions is easy and so is reusing them. An expression is a chain of functions with provided arguments, which given a single input translates to a single output.
Expression service exposes a registry of reusable functions primary used for fetching and transposing data and a registry of renderer functions that can render data into a DOM element.
Adding functions is easy and so is reusing them. An expression is a chain of functions with provided arguments, which given a single input translates to a single output.
Each expression is representable by a human friendly string which a user can type.

### creating expressions

Here is a very simple expression string:

essql 'select column1, column2 from myindex' | mapColumn name=column3 fn='{ column1 + 3 }' | table

```
essql 'select column1, column2 from myindex' | mapColumn name=column3 fn='{ column1 + 3 }' | table
```

It consists of 3 functions:

- essql which runs given sql query against elasticsearch and returns the results
- `mapColumn`, which computes a new column from existing ones;
- `table`, which prepares the data for rendering in a tabular format.

The same expression could also be constructed in the code:

```ts
Expand Down Expand Up @@ -61,7 +62,7 @@ In addition, on the browser side, there are two additional ways to run expressio
#### React expression renderer component
This is the easiest way to get expressions rendered inside your application.
This is the easiest way to get expressions rendered inside your application.
```ts
<ReactExpressionRenderer expression={expression} />
Expand Down
1 change: 1 addition & 0 deletions docs/developer/getting-started/monorepo-packages.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ yarn kbn watch-bazel
- @kbn/logging
- @kbn/mapbox-gl
- @kbn/monaco
- @kbn/rule-data-utils
- @kbn/securitysolution-es-utils
- @kbn/securitysolution-io-ts-alerting-types
- @kbn/securitysolution-io-ts-list-types
Expand Down
4 changes: 2 additions & 2 deletions docs/maps/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Create beautiful maps from your geographical data. With **Maps**, you can:
<img
style="width: 100%; margin: auto; display: block;"
class="vidyard-player-embed"
src="https://play.vidyard.com/BYzRDtH4u7RSD8wKhuEW1b.jpg"
data-uuid="BYzRDtH4u7RSD8wKhuEW1b"
src="https://play.vidyard.com/mBuWenQ2uSLY9YjEkPtzJC.jpg"
data-uuid="mBuWenQ2uSLY9YjEkPtzJC"
data-v="4"
data-type="inline"
/>
Expand Down
4 changes: 2 additions & 2 deletions docs/user/dashboard/lens.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ src="https://play.vidyard.com/embed/v4.js"></script>
<img
style="width: 100%; margin: auto; display: block;"
class="vidyard-player-embed"
src="https://play.vidyard.com/G6RNjq6U9odYRCYUxY2vfq.jpg"
data-uuid="G6RNjq6U9odYRCYUxY2vfq"
src="https://play.vidyard.com/vVJ69WCgUwGNJSDqjPZbaV.jpg"
data-uuid="vVJ69WCgUwGNJSDqjPZbaV"
data-v="4"
data-type="inline"
/>
Expand Down
4 changes: 2 additions & 2 deletions docs/user/introduction.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ which features.
<img
style="width: 100%; margin: auto; display: block;"
class="vidyard-player-embed"
src="https://play.vidyard.com/jW5wP2dmegbs5ThRZ451Gj.jpg"
data-uuid="jW5wP2dmegbs5ThRZ451Gj"
src="https://play.vidyard.com/iyqMwJcvi8r4YfjeoPMjyH.jpg"
data-uuid="iyqMwJcvi8r4YfjeoPMjyH"
data-v="4"
data-type="inline"
/>
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
"@kbn/legacy-logging": "link:bazel-bin/packages/kbn-legacy-logging",
"@kbn/logging": "link:bazel-bin/packages/kbn-logging",
"@kbn/monaco": "link:bazel-bin/packages/kbn-monaco",
"@kbn/rule-data-utils": "link:packages/kbn-rule-data-utils",
"@kbn/rule-data-utils": "link:bazel-bin/packages/kbn-rule-data-utils",
"@kbn/securitysolution-list-constants": "link:bazel-bin/packages/kbn-securitysolution-list-constants",
"@kbn/securitysolution-es-utils": "link:bazel-bin/packages/kbn-securitysolution-es-utils",
"@kbn/securitysolution-io-ts-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-types",
Expand Down Expand Up @@ -441,7 +441,7 @@
"@babel/traverse": "^7.12.12",
"@babel/types": "^7.12.12",
"@bazel/ibazel": "^0.15.10",
"@bazel/typescript": "^3.5.0",
"@bazel/typescript": "^3.5.1",
"@cypress/snapshot": "^2.1.7",
"@cypress/webpack-preprocessor": "^5.6.0",
"@elastic/apm-rum": "^5.6.1",
Expand Down
1 change: 1 addition & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ filegroup(
"//packages/kbn-mapbox-gl:build",
"//packages/kbn-monaco:build",
"//packages/kbn-plugin-generator:build",
"//packages/kbn-rule-data-utils:build",
"//packages/kbn-securitysolution-list-constants:build",
"//packages/kbn-securitysolution-io-ts-types:build",
"//packages/kbn-securitysolution-io-ts-alerting-types:build",
Expand Down
14 changes: 10 additions & 4 deletions packages/kbn-apm-utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export interface SpanOptions {
labels?: Record<string, string>;
}

type Span = Exclude<typeof agent.currentSpan, undefined | null>;

export function parseSpanOptions(optionsOrName: SpanOptions | string) {
const options = typeof optionsOrName === 'string' ? { name: optionsOrName } : optionsOrName;

Expand All @@ -30,7 +32,7 @@ const runInNewContext = <T extends (...args: any[]) => any>(cb: T): ReturnType<T

export async function withSpan<T>(
optionsOrName: SpanOptions | string,
cb: () => Promise<T>
cb: (span?: Span) => Promise<T>
): Promise<T> {
const options = parseSpanOptions(optionsOrName);

Expand Down Expand Up @@ -71,13 +73,17 @@ export async function withSpan<T>(
span.addLabels(labels);
}

return cb()
return cb(span)
.then((res) => {
span.outcome = 'success';
if (!span.outcome || span.outcome === 'unknown') {
span.outcome = 'success';
}
return res;
})
.catch((err) => {
span.outcome = 'failure';
if (!span.outcome || span.outcome === 'unknown') {
span.outcome = 'failure';
}
throw err;
})
.finally(() => {
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-legacy-logging/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ NPM_MODULE_EXTRA_FILES = [

SRC_DEPS = [
"//packages/kbn-config-schema",
"//packages/kbn-utils",
"@npm//@elastic/numeral",
"@npm//@hapi/hapi",
"@npm//chokidar",
Expand Down
79 changes: 79 additions & 0 deletions packages/kbn-rule-data-utils/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")

PKG_BASE_NAME = "kbn-rule-data-utils"
PKG_REQUIRE_NAME = "@kbn/rule-data-utils"

SOURCE_FILES = glob(
[
"src/**/*.ts",
],
)

SRCS = SOURCE_FILES

filegroup(
name = "srcs",
srcs = SRCS,
)

NPM_MODULE_EXTRA_FILES = [
"package.json",
]

SRC_DEPS = [
"@npm//tslib",
"@npm//utility-types",
]

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

DEPS = SRC_DEPS + TYPES_DEPS

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

ts_project(
name = "tsc",
args = ['--pretty'],
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 = NPM_MODULE_EXTRA_FILES,
deps = DEPS + [":tsc"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)

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

filegroup(
name = "build",
srcs = [
":npm_module",
],
visibility = ["//visibility:public"],
)
3 changes: 2 additions & 1 deletion packages/kbn-rule-data-utils/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"incremental": true,
"outDir": "./target",
"stripInternal": false,
"declaration": true,
"declarationMap": true,
"rootDir": "./src",
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-rule-data-utils/src",
"types": [
Expand Down
6 changes: 6 additions & 0 deletions packages/kbn-test/src/functional_test_runner/public_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ export interface GenericFtrProviderContext<
getService(serviceName: 'failureMetadata'): FailureMetadata;
getService<T extends keyof ServiceMap>(serviceName: T): ServiceMap[T];

/**
* Get the instance of a page object
* @param pageObjectName
*/
getPageObject<K extends keyof PageObjectMap>(pageObjectName: K): PageObjectMap[K];

/**
* Get a map of PageObjects
* @param pageObjects
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* 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.
*/

export const applyExportTransformsMock = jest.fn();
jest.doMock('./apply_export_transforms', () => ({
applyExportTransforms: applyExportTransformsMock,
}));

0 comments on commit 39dfd5f

Please sign in to comment.