Skip to content

Commit

Permalink
Merge branch 'main' into eui/41-2-0
Browse files Browse the repository at this point in the history
  • Loading branch information
1Copenut authored Dec 8, 2021
2 parents de8c73e + e94d63f commit 93d86b8
Show file tree
Hide file tree
Showing 577 changed files with 12,785 additions and 5,905 deletions.
2 changes: 1 addition & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ MIT License http://www.opensource.org/licenses/mit-license
---
This product includes code that is adapted from mapbox-gl-js, which is
available under a "BSD-3-Clause" license.
https://github.com/mapbox/mapbox-gl-js/blob/master/src/util/image.js
https://github.com/mapbox/mapbox-gl-js/blob/v1.13.2/src/util/image.js

Copyright (c) 2016, Mapbox

Expand Down
6 changes: 3 additions & 3 deletions docs/settings/apm-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ Changing these settings may disable features of the APM App.
| `xpack.apm.indices.sourcemap` {ess-icon}
| Matcher for all source map indices. Defaults to `apm-*`.

| `xpack.apm.autocreateApmIndexPattern` {ess-icon}
| Set to `false` to disable the automatic creation of the APM index pattern when the APM app is opened. Defaults to `true`.
| `xpack.apm.autoCreateApmDataView` {ess-icon}
| Set to `false` to disable the automatic creation of the APM data view when the APM app is opened. Defaults to `true`.
|===

// end::general-apm-settings[]
// end::general-apm-settings[]
2 changes: 2 additions & 0 deletions docs/settings/fleet-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ Optional properties are:
`data_output_id`:: ID of the output to send data (Need to be identical to `monitoring_output_id`)
`monitoring_output_id`:: ID of the output to send monitoring data. (Need to be identical to `data_output_id`)
`package_policies`:: List of integration policies to add to this policy.
`id`::: Unique ID of the integration policy. The ID may be a number or string.
`name`::: (required) Name of the integration policy.
`package`::: (required) Integration that this policy configures
`name`:::: Name of the integration associated with this policy.
Expand Down Expand Up @@ -128,6 +129,7 @@ xpack.fleet.agentPolicies:
- package:
name: system
name: System Integration
id: preconfigured-system
inputs:
- type: system/metrics
enabled: true
Expand Down
13 changes: 10 additions & 3 deletions docs/setup/upgrade.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,20 @@ a|
[[upgrade-before-you-begin]]
=== Before you begin

WARNING: {kib} automatically runs upgrade migrations when required. To roll back to an earlier version in case of an upgrade failure, you **must** have a {ref}/snapshot-restore.html[backup snapshot] available. This snapshot must include the `kibana` feature state or all `kibana*` indices. For more information see <<upgrade-migrations, upgrade migrations>>.
[WARNING]
====
{kib} automatically runs upgrade migrations when required. To roll back to an
earlier version in case of an upgrade failure, you **must** have a
{ref}/snapshot-restore.html[backup snapshot] that includes the `kibana` feature
state. Snapshots include this feature state by default.
For more information, refer to <<upgrade-migrations, upgrade migrations>>.
====

Before you upgrade {kib}:

* Consult the <<breaking-changes,breaking changes>>.
* {ref}/snapshots-take-snapshot.html[Take a snapshot] of your data. To roll back to an earlier version, the snapshot must include the `kibana` feature state or all `.kibana*` indices.
* Although not a requirement for rollbacks, we recommend taking a snapshot of all {kib} indices created by the plugins you use such as the `.reporting*` indices created by the reporting plugin.
* {ref}/snapshots-take-snapshot.html[Take a snapshot] of your data. To roll back to an earlier version, the snapshot must include the `kibana` feature state.
* Before you upgrade production servers, test the upgrades in a dev environment.
* See <<preventing-migration-failures, preventing migration failures>> for common reasons upgrades fail and how to prevent these.
* If you are using custom plugins, check that a compatible version is
Expand Down
7 changes: 4 additions & 3 deletions docs/setup/upgrade/upgrade-migrations.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,18 @@ In order to rollback after a failed upgrade migration, the saved object indices
[float]
===== Rollback by restoring a backup snapshot:

1. Before proceeding, {ref}/snapshots-take-snapshot.html[take a snapshot] that contains the `kibana` feature state or all `.kibana*` indices.
1. Before proceeding, {ref}/snapshots-take-snapshot.html[take a snapshot] that contains the `kibana` feature state.
Snapshots include this feature state by default.
2. Shutdown all {kib} instances to be 100% sure that there are no instances currently performing a migration.
3. Delete all saved object indices with `DELETE /.kibana*`
4. {ref}/snapshots-restore-snapshot.html[Restore] the `kibana` feature state or all `.kibana* indices and their aliases from the snapshot.
4. {ref}/snapshots-restore-snapshot.html[Restore] the `kibana` feature state from the snapshot.
5. Start up all {kib} instances on the older version you wish to rollback to.

[float]
===== (Not recommended) Rollback without a backup snapshot:

1. Shutdown all {kib} instances to be 100% sure that there are no {kib} instances currently performing a migration.
2. {ref}/snapshots-take-snapshot.html[Take a snapshot] that includes the `kibana` feature state or all `.kibana*` indices.
2. {ref}/snapshots-take-snapshot.html[Take a snapshot] that includes the `kibana` feature state. Snapshots include this feature state by default.
3. Delete the version specific indices created by the failed upgrade migration. E.g. if you wish to rollback from a failed upgrade to v7.12.0 `DELETE /.kibana_7.12.0_*,.kibana_task_manager_7.12.0_*`
4. Inspect the output of `GET /_cat/aliases`. If either the `.kibana` and/or `.kibana_task_manager` alias is missing, these will have to be created manually. Find the latest index from the output of `GET /_cat/indices` and create the missing alias to point to the latest index. E.g. if the `.kibana` alias was missing and the latest index is `.kibana_3` create a new alias with `POST /.kibana_3/_aliases/.kibana`.
5. Remove the write block from the rollback indices. `PUT /.kibana,.kibana_task_manager/_settings {"index.blocks.write": false}`
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@
"@elastic/ems-client": "8.0.0",
"@elastic/eui": "41.2.3",
"@elastic/filesaver": "1.1.2",
"@elastic/maki": "6.3.0",
"@elastic/node-crypto": "1.2.1",
"@elastic/numeral": "^2.5.1",
"@elastic/react-search-ui": "^1.6.0",
Expand Down Expand Up @@ -196,8 +195,10 @@
"archiver": "^5.2.0",
"axios": "^0.21.1",
"base64-js": "^1.3.1",
"bitmap-sdf": "^1.0.3",
"brace": "0.11.1",
"broadcast-channel": "^4.7.0",
"canvg": "^3.0.9",
"chalk": "^4.1.0",
"cheerio": "^1.0.0-rc.10",
"chokidar": "^3.4.3",
Expand Down Expand Up @@ -567,7 +568,9 @@
"@types/kbn__config": "link:bazel-bin/packages/kbn-config/npm_module_types",
"@types/kbn__config-schema": "link:bazel-bin/packages/kbn-config-schema/npm_module_types",
"@types/kbn__crypto": "link:bazel-bin/packages/kbn-crypto/npm_module_types",
"@types/kbn__dev-utils": "link:bazel-bin/packages/kbn-dev-utils/npm_module_types",
"@types/kbn__docs-utils": "link:bazel-bin/packages/kbn-docs-utils/npm_module_types",
"@types/kbn__es-archiver": "link:bazel-bin/packages/kbn-es-archiver/npm_module_types",
"@types/kbn__i18n": "link:bazel-bin/packages/kbn-i18n/npm_module_types",
"@types/kbn__i18n-react": "link:bazel-bin/packages/kbn-i18n-react/npm_module_types",
"@types/license-checker": "15.0.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ filegroup(
"//packages/kbn-config:build_types",
"//packages/kbn-config-schema:build_types",
"//packages/kbn-crypto:build_types",
"//packages/kbn-dev-utils:build_types",
"//packages/kbn-docs-utils:build_types",
"//packages/kbn-es-archiver:build_types",
"//packages/kbn-i18n:build_types",
"//packages/kbn-i18n-react:build_types",
],
Expand Down
2 changes: 1 addition & 1 deletion packages/elastic-eslint-config-kibana/react.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const semver = require('semver');
const { kibanaPackageJson: PKG } = require('@kbn/dev-utils');
const { kibanaPackageJson: PKG } = require('@kbn/utils');

module.exports = {
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion packages/elastic-eslint-config-kibana/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// as this package was moved from typescript-eslint-parser to @typescript-eslint/parser

const semver = require('semver');
const { kibanaPackageJson: PKG } = require('@kbn/dev-utils');
const { kibanaPackageJson: PKG } = require('@kbn/utils');

const eslintConfigPrettierTypescriptEslintRules = require('eslint-config-prettier/@typescript-eslint').rules;

Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-cli-dev-mode/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ RUNTIME_DEPS = [
TYPES_DEPS = [
"//packages/kbn-config:npm_module_types",
"//packages/kbn-config-schema:npm_module_types",
"//packages/kbn-dev-utils",
"//packages/kbn-dev-utils:npm_module_types",
"//packages/kbn-logging",
"//packages/kbn-optimizer",
"//packages/kbn-server-http-tools",
Expand Down
8 changes: 3 additions & 5 deletions packages/kbn-cli-dev-mode/src/cli_dev_mode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@

import Path from 'path';
import * as Rx from 'rxjs';
import {
REPO_ROOT,
createAbsolutePathSerializer,
createAnyInstanceSerializer,
} from '@kbn/dev-utils';
import { createAbsolutePathSerializer, createAnyInstanceSerializer } from '@kbn/dev-utils';

import { REPO_ROOT } from '@kbn/utils';

import { TestLog } from './log';
import { CliDevMode, SomeCliArgs } from './cli_dev_mode';
Expand Down
3 changes: 2 additions & 1 deletion packages/kbn-cli-dev-mode/src/cli_dev_mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import {
takeUntil,
} from 'rxjs/operators';
import { CliArgs } from '@kbn/config';
import { REPO_ROOT, CiStatsReporter } from '@kbn/dev-utils';
import { CiStatsReporter } from '@kbn/dev-utils';
import { REPO_ROOT } from '@kbn/utils';

import { Log, CliLog } from './log';
import { Optimizer } from './optimizer';
Expand Down
3 changes: 2 additions & 1 deletion packages/kbn-cli-dev-mode/src/get_server_watch_paths.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

import Path from 'path';

import { REPO_ROOT, createAbsolutePathSerializer } from '@kbn/dev-utils';
import { createAbsolutePathSerializer } from '@kbn/dev-utils';
import { REPO_ROOT } from '@kbn/utils';

import { getServerWatchPaths } from './get_server_watch_paths';

Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-cli-dev-mode/src/get_server_watch_paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Path from 'path';
import Fs from 'fs';

import { REPO_ROOT } from '@kbn/dev-utils';
import { REPO_ROOT } from '@kbn/utils';

interface Options {
pluginPaths: string[];
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-crypto/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUNTIME_DEPS = [
]

TYPES_DEPS = [
"//packages/kbn-dev-utils",
"//packages/kbn-dev-utils:npm_module_types",
"@npm//@types/flot",
"@npm//@types/jest",
"@npm//@types/node",
Expand Down
28 changes: 22 additions & 6 deletions packages/kbn-dev-utils/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("//src/dev/bazel:index.bzl", "jsts_transpiler")
load("@npm//@bazel/typescript:index.bzl", "ts_config")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")

PKG_BASE_NAME = "kbn-dev-utils"
PKG_REQUIRE_NAME = "@kbn/dev-utils"
TYPES_PKG_REQUIRE_NAME = "@types/kbn__dev-utils"

SOURCE_FILES = glob(
[
Expand Down Expand Up @@ -43,7 +44,6 @@ NPM_MODULE_EXTRA_FILES = [
]

RUNTIME_DEPS = [
"//packages/kbn-std",
"//packages/kbn-utils",
"@npm//@babel/core",
"@npm//axios",
Expand All @@ -66,7 +66,6 @@ RUNTIME_DEPS = [
]

TYPES_DEPS = [
"//packages/kbn-std",
"//packages/kbn-utils",
"@npm//@babel/parser",
"@npm//@babel/types",
Expand Down Expand Up @@ -124,7 +123,7 @@ ts_project(
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = RUNTIME_DEPS + [":target_node", ":tsc_types"],
deps = RUNTIME_DEPS + [":target_node"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
Expand All @@ -143,3 +142,20 @@ filegroup(
],
visibility = ["//visibility:public"],
)

pkg_npm_types(
name = "npm_module_types",
srcs = SRCS,
deps = [":tsc_types"],
package_name = TYPES_PKG_REQUIRE_NAME,
tsconfig = ":tsconfig",
visibility = ["//visibility:public"],
)

filegroup(
name = "build_types",
srcs = [
":npm_module_types",
],
visibility = ["//visibility:public"],
)
1 change: 0 additions & 1 deletion packages/kbn-dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"private": true,
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target_node/index.js",
"types": "./target_types/index.d.ts",
"kibana": {
"devOnly": true
}
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-dev-utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Side Public License, v 1.
*/

export * from '@kbn/utils';
export { withProcRunner, ProcRunner } from './proc_runner';
export * from './tooling_log';
export * from './serializers';
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-docs-utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RUNTIME_DEPS = [

TYPES_DEPS = [
"//packages/kbn-config:npm_module_types",
"//packages/kbn-dev-utils",
"//packages/kbn-dev-utils:npm_module_types",
"//packages/kbn-utils",
"@npm//ts-morph",
"@npm//@types/dedent",
Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-docs-utils/src/api_docs/build_api_docs_cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import Fs from 'fs';
import Path from 'path';

import { REPO_ROOT, run, CiStatsReporter, createFlagError } from '@kbn/dev-utils';
import { run, CiStatsReporter, createFlagError } from '@kbn/dev-utils';
import { REPO_ROOT } from '@kbn/utils';
import { Project } from 'ts-morph';

import { writePluginDocs } from './mdx/write_plugin_mdx_docs';
Expand Down Expand Up @@ -241,7 +242,7 @@ export function runBuildApiDocsCli() {
boolean: ['references'],
help: `
--plugin Optionally, run for only a specific plugin
--stats Optionally print API stats. Must be one or more of: any, comments or exports.
--stats Optionally print API stats. Must be one or more of: any, comments or exports.
--references Collect references for API items
`,
},
Expand Down
3 changes: 2 additions & 1 deletion packages/kbn-docs-utils/src/api_docs/find_plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import globby from 'globby';
import loadJsonFile from 'load-json-file';

import { getPluginSearchPaths } from '@kbn/config';
import { simpleKibanaPlatformPluginDiscovery, REPO_ROOT } from '@kbn/dev-utils';
import { simpleKibanaPlatformPluginDiscovery } from '@kbn/dev-utils';
import { REPO_ROOT } from '@kbn/utils';
import { ApiScope, PluginOrPackage } from './types';

export function findPlugins(): PluginOrPackage[] {
Expand Down
28 changes: 23 additions & 5 deletions packages/kbn-es-archiver/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("//src/dev/bazel:index.bzl", "jsts_transpiler")
load("@npm//@bazel/typescript:index.bzl", "ts_config")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")

PKG_BASE_NAME = "kbn-es-archiver"
PKG_REQUIRE_NAME = "@kbn/es-archiver"
TYPES_PKG_REQUIRE_NAME = "@types/kbn__es-archiver"

SOURCE_FILES = glob(
[
Expand Down Expand Up @@ -43,7 +44,7 @@ RUNTIME_DEPS = [
]

TYPES_DEPS = [
"//packages/kbn-dev-utils",
"//packages/kbn-dev-utils:npm_module_types",
"//packages/kbn-test",
"//packages/kbn-utils",
"@npm//@elastic/elasticsearch",
Expand Down Expand Up @@ -90,7 +91,7 @@ ts_project(
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = RUNTIME_DEPS + [":target_node", ":tsc_types"],
deps = RUNTIME_DEPS + [":target_node"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
Expand All @@ -109,3 +110,20 @@ filegroup(
],
visibility = ["//visibility:public"],
)

pkg_npm_types(
name = "npm_module_types",
srcs = SRCS,
deps = [":tsc_types"],
package_name = TYPES_PKG_REQUIRE_NAME,
tsconfig = ":tsconfig",
visibility = ["//visibility:public"],
)

filegroup(
name = "build_types",
srcs = [
":npm_module_types",
],
visibility = ["//visibility:public"],
)
1 change: 0 additions & 1 deletion packages/kbn-es-archiver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"license": "SSPL-1.0 OR Elastic License 2.0",
"private": "true",
"main": "target_node/index.js",
"types": "target_types/index.d.ts",
"kibana": {
"devOnly": true
}
Expand Down
3 changes: 2 additions & 1 deletion packages/kbn-es-archiver/src/actions/load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import { resolve, relative } from 'path';
import { createReadStream } from 'fs';
import { Readable } from 'stream';
import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils';
import { ToolingLog } from '@kbn/dev-utils';
import { REPO_ROOT } from '@kbn/utils';
import { KbnClient } from '@kbn/test';
import type { Client } from '@elastic/elasticsearch';
import { createPromiseFromStreams, concatStreamProviders } from '@kbn/utils';
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-es-archiver/src/actions/rebuild_all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { resolve, relative } from 'path';
import { Stats, createReadStream, createWriteStream } from 'fs';
import { stat, rename } from 'fs/promises';
import { Readable, Writable } from 'stream';
import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils';
import { createPromiseFromStreams } from '@kbn/utils';
import { ToolingLog } from '@kbn/dev-utils';
import { createPromiseFromStreams, REPO_ROOT } from '@kbn/utils';
import {
prioritizeMappings,
readDirectory,
Expand Down
Loading

0 comments on commit 93d86b8

Please sign in to comment.