Skip to content

Commit

Permalink
Merge branch 'master' into feature/olm-user_can_add_new_event_filter_…
Browse files Browse the repository at this point in the history
…from_event_filter_list-955
  • Loading branch information
kibanamachine authored Apr 26, 2021
2 parents 3836333 + f7ed987 commit f90beee
Show file tree
Hide file tree
Showing 267 changed files with 5,476 additions and 2,104 deletions.
2 changes: 2 additions & 0 deletions docs/developer/getting-started/monorepo-packages.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ yarn kbn watch-bazel
=== List of Already Migrated Packages to Bazel

- @elastic/datemath
- @elastic/safer-lodash-set
- @kbn/apm-utils
- @kbn/babel-code-parser
- @kbn/babel-preset
- @kbn/config-schema
- @kbn/std
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [CustomHttpResponseOptions](./kibana-plugin-core-server.customhttpresponseoptions.md) &gt; [bypassErrorFormat](./kibana-plugin-core-server.customhttpresponseoptions.bypasserrorformat.md)

## CustomHttpResponseOptions.bypassErrorFormat property

Bypass the default error formatting

<b>Signature:</b>

```typescript
bypassErrorFormat?: boolean;
```
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface CustomHttpResponseOptions<T extends HttpResponsePayload | Respo
| Property | Type | Description |
| --- | --- | --- |
| [body](./kibana-plugin-core-server.customhttpresponseoptions.body.md) | <code>T</code> | HTTP message to send to the client |
| [bypassErrorFormat](./kibana-plugin-core-server.customhttpresponseoptions.bypasserrorformat.md) | <code>boolean</code> | Bypass the default error formatting |
| [headers](./kibana-plugin-core-server.customhttpresponseoptions.headers.md) | <code>ResponseHeaders</code> | HTTP Headers with additional information about response |
| [statusCode](./kibana-plugin-core-server.customhttpresponseoptions.statuscode.md) | <code>number</code> | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [HttpResponseOptions](./kibana-plugin-core-server.httpresponseoptions.md) &gt; [bypassErrorFormat](./kibana-plugin-core-server.httpresponseoptions.bypasserrorformat.md)

## HttpResponseOptions.bypassErrorFormat property

Bypass the default error formatting

<b>Signature:</b>

```typescript
bypassErrorFormat?: boolean;
```
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ export interface HttpResponseOptions
| Property | Type | Description |
| --- | --- | --- |
| [body](./kibana-plugin-core-server.httpresponseoptions.body.md) | <code>HttpResponsePayload</code> | HTTP message to send to the client |
| [bypassErrorFormat](./kibana-plugin-core-server.httpresponseoptions.bypasserrorformat.md) | <code>boolean</code> | Bypass the default error formatting |
| [headers](./kibana-plugin-core-server.httpresponseoptions.headers.md) | <code>ResponseHeaders</code> | HTTP Headers with additional information about response |

7 changes: 7 additions & 0 deletions docs/user/dashboard/dashboard.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,13 @@ To add a panel to another dashboard, copy the panel.

View the underlying documents in a panel, or in a data series.

. In kibana.yml, add the following:
+
["source","yml"]
-----------
xpack.discoverEnhanced.actions.exploreDataInContextMenu.enabled: true
-----------

TIP: *Explore underlying data* is supported only for visualization panels with a single index pattern.

To view the underlying documents in the panel:
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"dependencies": {
"@elastic/apm-rum": "^5.6.1",
"@elastic/apm-rum-react": "^1.2.5",
"@elastic/charts": "29.0.0",
"@elastic/charts": "29.1.0",
"@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.13.0",
Expand All @@ -109,7 +109,7 @@
"@elastic/numeral": "^2.5.0",
"@elastic/react-search-ui": "^1.5.1",
"@elastic/request-crypto": "1.1.4",
"@elastic/safer-lodash-set": "link:packages/elastic-safer-lodash-set",
"@elastic/safer-lodash-set": "link:bazel-bin/packages/elastic-safer-lodash-set/npm_module",
"@elastic/search-ui-app-search-connector": "^1.5.0",
"@elastic/ui-ace": "0.2.3",
"@hapi/boom": "^9.1.1",
Expand Down Expand Up @@ -437,7 +437,7 @@
"@elastic/makelogs": "^6.0.0",
"@istanbuljs/schema": "^0.1.2",
"@jest/reporters": "^26.6.2",
"@kbn/babel-code-parser": "link:packages/kbn-babel-code-parser",
"@kbn/babel-code-parser": "link:bazel-bin/packages/kbn-babel-code-parser/npm_module",
"@kbn/babel-preset": "link:bazel-bin/packages/kbn-babel-preset/npm_module",
"@kbn/cli-dev-mode": "link:packages/kbn-cli-dev-mode",
"@kbn/dev-utils": "link:packages/kbn-dev-utils",
Expand Down
2 changes: 2 additions & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ filegroup(
name = "build",
srcs = [
"//packages/elastic-datemath:build",
"//packages/elastic-safer-lodash-set:build",
"//packages/kbn-apm-utils:build",
"//packages/kbn-babel-code-parser:build",
"//packages/kbn-babel-preset:build",
"//packages/kbn-config-schema:build",
"//packages/kbn-std:build",
Expand Down
3 changes: 1 addition & 2 deletions packages/elastic-datemath/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,14 @@ ts_project(

js_library(
name = PKG_BASE_NAME,
srcs = [],
srcs = NPM_MODULE_EXTRA_FILES,
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,
]
Expand Down
65 changes: 65 additions & 0 deletions packages/elastic-safer-lodash-set/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")

PKG_BASE_NAME = "elastic-safer-lodash-set"
PKG_REQUIRE_NAME = "@elastic/safer-lodash-set"

SOURCE_FILES = glob(
[
"fp/**/*",
"lodash/**/*",
"index.js",
"set.js",
"setWith.js",
],
exclude = [
"**/*.d.ts"
],
)

TYPE_FILES = glob([
"fp/**/*.d.ts",
"index.d.ts",
"set.d.ts",
"setWith.d.ts",
])

SRCS = SOURCE_FILES + TYPE_FILES

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

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

DEPS = [
"@npm//lodash",
]

js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES + [
":srcs",
],
deps = DEPS,
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"],
)
2 changes: 1 addition & 1 deletion packages/elastic-safer-lodash-set/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"tsBuildInfoFile": "../../build/tsbuildinfo/packages/elastic-safer-lodash-set"
"incremental": false,
},
"include": [
"**/*",
Expand Down
3 changes: 0 additions & 3 deletions packages/kbn-apm-config-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@
"build": "../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build",
"kbn:watch": "yarn build --watch"
},
"dependencies": {
"@elastic/safer-lodash-set": "link:../elastic-safer-lodash-set"
}
}
3 changes: 1 addition & 2 deletions packages/kbn-apm-utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,14 @@ ts_project(

js_library(
name = PKG_BASE_NAME,
srcs = [],
srcs = NPM_MODULE_EXTRA_FILES,
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,
]
Expand Down
71 changes: 71 additions & 0 deletions packages/kbn-babel-code-parser/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("@npm//@babel/cli:index.bzl", "babel")

PKG_BASE_NAME = "kbn-babel-code-parser"
PKG_REQUIRE_NAME = "@kbn/babel-code-parser"

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

SRCS = SOURCE_FILES

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

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

DEPS = [
"//packages/kbn-babel-preset",
"@npm//@babel/parser",
"@npm//@babel/traverse",
"@npm//lodash",
]

babel(
name = "target",
data = [
":srcs",
".babelrc",
] + DEPS,
output_dir = True,
args = [
"./%s/src" % package_name(),
"--out-dir",
"$(@D)",
"--quiet"
],
)

js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = [":target"] + DEPS,
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"],
)
5 changes: 0 additions & 5 deletions packages/kbn-babel-code-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,5 @@
"repository": {
"type": "git",
"url": "https://github.com/elastic/kibana/tree/master/packages/kbn-babel-code-parser"
},
"scripts": {
"build": "../../node_modules/.bin/babel src --out-dir target",
"kbn:bootstrap": "yarn build --quiet",
"kbn:watch": "yarn build --watch"
}
}
3 changes: 1 addition & 2 deletions packages/kbn-babel-preset/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ DEPS = [

js_library(
name = PKG_BASE_NAME,
srcs = [
srcs = NPM_MODULE_EXTRA_FILES + [
":srcs",
],
deps = DEPS,
Expand All @@ -48,7 +48,6 @@ js_library(

pkg_npm(
name = "npm_module",
srcs = NPM_MODULE_EXTRA_FILES,
deps = [
":%s" % PKG_BASE_NAME,
]
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"kbn:bootstrap": "yarn build"
},
"dependencies": {
"@elastic/safer-lodash-set": "link:../elastic-safer-lodash-set",
"@kbn/logging": "link:../kbn-logging"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function runKibanaServer({ procs, config, options }) {
...extendNodeOptions(installDir),
},
cwd: installDir || KIBANA_ROOT,
wait: /http server running/,
wait: /\[Kibana\]\[http\] http server running/,
});
}

Expand Down
9 changes: 9 additions & 0 deletions packages/kbn-test/src/kbn_client/kbn_client_requester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ const isConcliftOnGetError = (error: any) => {
);
};

const isIgnorableError = (error: any, ignorableErrors: number[] = []) => {
return isAxiosResponseError(error) && ignorableErrors.includes(error.response.status);
};

export const uriencode = (
strings: TemplateStringsArray,
...values: Array<string | number | boolean>
Expand Down Expand Up @@ -53,6 +57,7 @@ export interface ReqOptions {
body?: any;
retries?: number;
headers?: Record<string, string>;
ignoreErrors?: number[];
responseType?: ResponseType;
}

Expand Down Expand Up @@ -125,6 +130,10 @@ export class KbnClientRequester {
const requestedRetries = options.retries !== undefined;
const failedToGetResponse = isAxiosRequestError(error);

if (isIgnorableError(error, options.ignoreErrors)) {
return error.response;
}

let errorMessage;
if (conflictOnGet) {
errorMessage = `Conflict on GET (path=${options.path}, attempt=${attempt}/${maxAttempts})`;
Expand Down
2 changes: 2 additions & 0 deletions packages/kbn-test/src/kbn_client/kbn_client_status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export class KbnClientStatus {
const { data } = await this.requester.request<ApiResponseStatus>({
method: 'GET',
path: 'api/status',
// Status endpoint returns 503 if any services are in an unavailable state
ignoreErrors: [503],
});
return data;
}
Expand Down
3 changes: 1 addition & 2 deletions packages/kbn-tinymath/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ peggy(

js_library(
name = PKG_BASE_NAME,
srcs = [
srcs = NPM_MODULE_EXTRA_FILES + [
":srcs",
":grammar"
],
Expand All @@ -56,7 +56,6 @@ js_library(

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

0 comments on commit f90beee

Please sign in to comment.