Skip to content

Commit

Permalink
Merge branch '7.x' into backport/7.x/pr-103331
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Jun 29, 2021
2 parents 4fd6182 + f94c42e commit 34b2cd5
Show file tree
Hide file tree
Showing 282 changed files with 10,711 additions and 3,055 deletions.
12 changes: 12 additions & 0 deletions docs/api/saved-objects/import.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@

experimental[] Create sets of {kib} saved objects from a file created by the export API.

==== Compatibility across versions
Saved objects can only be imported into the same version, a newer minor on the same major, or the next major. Exported saved objects are not backwards compatible and cannot be imported into an older version of {kib}. See the table below for compatibility examples:

|=======
| Exporting version | Importing version | Compatible?
| 6.7.0 | 6.8.1 | Yes
| 6.8.1 | 7.3.0 | Yes
| 7.3.0 | 7.11.1 | Yes
| 7.11.1 | 7.6.0 | No
| 6.8.1 | 8.0.0 | No
|=======

[[saved-objects-api-import-request]]
==== Request

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 @@ -107,6 +107,7 @@ yarn kbn watch-bazel
- @kbn/std
- @kbn/storybook
- @kbn/telemetry-utils
- @kbn/test-subj-selector
- @kbn/tinymath
- @kbn/ui-framework
- @kbn/ui-shared-deps
Expand Down
15 changes: 15 additions & 0 deletions docs/management/managing-saved-objects.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,21 @@ have multiple environments for development and production.
Import and export also work well when you have a large number
of objects to update and want to batch the process.

[float]
==== Compatibility across versions

With each release, {kib} introduces changes to the way saved objects are stored. When importing a saved object, {kib} will run the necessary migrations to ensure that the imported saved objects are compatible with the current version.

However, saved objects can only be imported into the same version, a newer minor on the same major, or the next major. Exported saved objects are not backwards compatible and cannot be imported into an older version of {kib}. See the table below for compatibility examples:

|=======
| Exporting version | Importing version | Compatible?
| 6.7.0 | 6.8.1 | Yes
| 6.8.1 | 7.3.0 | Yes
| 7.3.0 | 7.11.1 | Yes
| 7.11.1 | 7.6.0 | No
| 6.8.1 | 8.0.0 | No
|=======

[float]
==== Import
Expand Down
14 changes: 9 additions & 5 deletions docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Set to `false` to disable Console. *Default: `true`*
<<ops-cGroupOverrides-cpuAcctPath, `ops.cGroupOverrides.cpuAcctPath`>>.

| `csp.rules:`
| deprecated:[7.14.0,"In 8.0 and later, this setting will no longer be supported."]
| deprecated:[7.14.0,"In 8.0 and later, this setting will no longer be supported."]
A https://w3c.github.io/webappsec-csp/[Content Security Policy] template
that disables certain unnecessary and potentially insecure capabilities in
the browser. It is strongly recommended that you keep the default CSP rules
Expand Down Expand Up @@ -73,8 +73,8 @@ that ship with {kib}.

[NOTE]
============
The `frame-ancestors` directive can also be configured by using
<<server-securityResponseHeaders-disableEmbedding, `server.securityResponseHeaders.disableEmbedding`>>. In that case, that takes precedence and any values in `csp.frame_ancestors`
The `frame-ancestors` directive can also be configured by using
<<server-securityResponseHeaders-disableEmbedding, `server.securityResponseHeaders.disableEmbedding`>>. In that case, that takes precedence and any values in `csp.frame_ancestors`
are ignored.
============

Expand Down Expand Up @@ -777,10 +777,14 @@ out through *Advanced Settings*. *Default: `true`*
| Set this value to true to allow Vega to use any URL to access external data
sources and images. When false, Vega can only get data from {es}. *Default: `false`*

| `xpack.discoverEnhanced.actions.exploreDataInContextMenu.enabled`
a|
`xpack.discoverEnhanced.actions.`
`exploreDataInContextMenu.enabled`
| Enables the *Explore underlying data* option that allows you to open *Discover* from a dashboard panel and view the panel data. *Default: `false`*

| `xpack.discoverEnhanced.actions.exploreDataInChart.enabled`
a|
`xpack.discoverEnhanced.actions.`
`exploreDataInChart.enabled`
| Enables you to view the underlying documents in a data series from a dashboard panel. *Default: `false`*

| `xpack.license_management.enabled`
Expand Down
12 changes: 10 additions & 2 deletions docs/user/monitoring/kibana-alerts.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ specific needs.
[role="screenshot"]
image::user/monitoring/images/monitoring-kibana-alerting-notification.png["{kib} alerting notifications in {stack-monitor-app}"]

When you open *{stack-monitor-app}*, the preconfigured rules are created
automatically. They are initially configured to detect and notify on various
When you open *{stack-monitor-app}*, you will be ask to create these rules
They are initially configured to detect and notify on various
conditions across your monitored clusters. You can view notifications for: *Cluster health*, *Resource utilization*, and *Errors and exceptions* for {es}
in real time.

Expand Down Expand Up @@ -131,6 +131,14 @@ soon the expiration date is:
The 60-day and 30-day thresholds are skipped for Trial licenses, which are only
valid for 30 days.

[discrete]
== Alerts and rules
[discrete]
=== Create default rules
This option can be used to create default rules in this kibana spaces. This is
useful for scenarios when you didn't choose to create these default rules initially
or anytime later if the rules were accidentally deleted.

NOTE: Some action types are subscription features, while others are free.
For a comparison of the Elastic subscription levels, see the alerting section of
the {subscriptions}[Subscriptions page].
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@
"@kbn/storybook": "link:bazel-bin/packages/kbn-storybook",
"@kbn/telemetry-tools": "link:bazel-bin/packages/kbn-telemetry-tools",
"@kbn/test": "link:packages/kbn-test",
"@kbn/test-subj-selector": "link:packages/kbn-test-subj-selector",
"@kbn/test-subj-selector": "link:bazel-bin/packages/kbn-test-subj-selector",
"@loaders.gl/polyfills": "^2.3.5",
"@microsoft/api-documenter": "7.7.2",
"@microsoft/api-extractor": "7.7.0",
Expand Down
1 change: 1 addition & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ filegroup(
"//packages/kbn-std:build",
"//packages/kbn-storybook:build",
"//packages/kbn-telemetry-tools:build",
"//packages/kbn-test-subj-selector:build",
"//packages/kbn-tinymath:build",
"//packages/kbn-ui-framework:build",
"//packages/kbn-ui-shared-deps:build",
Expand Down
9 changes: 7 additions & 2 deletions packages/kbn-eslint-plugin-eslint/rules/module_migration.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
const path = require('path');
const KIBANA_ROOT = path.resolve(__dirname, '../../..');

function checkModuleNameNode(context, mappings, node) {
function checkModuleNameNode(context, mappings, node, desc = 'Imported') {
const mapping = mappings.find(
(mapping) => mapping.from === node.value || node.value.startsWith(`${mapping.from}/`)
);
Expand Down Expand Up @@ -42,7 +42,7 @@ function checkModuleNameNode(context, mappings, node) {
}

context.report({
message: `Imported module "${node.value}" should be "${newSource}"`,
message: `${desc} module "${node.value}" should be "${newSource}"`,
loc: node.loc,
fix(fixer) {
return fixer.replaceText(node, `'${newSource}'`);
Expand Down Expand Up @@ -101,6 +101,11 @@ module.exports = {
ImportDeclaration(node) {
checkModuleNameNode(context, mappings, node.source);
},
ExportNamedDeclaration(node) {
if (node.source) {
checkModuleNameNode(context, mappings, node.source, 'Re-exported');
}
},
CallExpression(node) {
if (
node.callee.type === 'Identifier' &&
Expand Down
74 changes: 74 additions & 0 deletions packages/kbn-eslint-plugin-eslint/rules/module_migration.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* 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.
*/

const { RuleTester } = require('eslint');
const rule = require('./module_migration');
const dedent = require('dedent');

const ruleTester = new RuleTester({
parser: require.resolve('babel-eslint'),
parserOptions: {
ecmaVersion: 2018,
},
});

ruleTester.run('@kbn/eslint/module-migration', rule, {
valid: [
{
code: dedent`
import "bar"
require('bar')
export { foo } from "bar"
export const foo2 = 'bar'
`,

options: [
[
{
from: 'foo',
to: 'bar',
},
],
],
},
],

invalid: [
{
code: dedent`
import "foo"
require('foo/foo2')
export { foo } from 'foo'
export const foo2 = 'bar'
`,

options: [
[
{
from: 'foo',
to: 'bar',
},
],
],
errors: [
{
line: 1,
message: 'Imported module "foo" should be "bar"',
},
{
line: 2,
message: 'Imported module "foo/foo2" should be "bar/foo2"',
},
{
line: 3,
message: 'Re-exported module "foo" should be "bar"',
},
],
},
],
});
3 changes: 2 additions & 1 deletion packages/kbn-i18n/src/react/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

// eslint-disable-next-line @kbn/eslint/module_migration
import { InjectedIntl as _InjectedIntl, InjectedIntlProps as _InjectedIntlProps } from 'react-intl';
// eslint-disable-next-line @kbn/eslint/module_migration
export type { InjectedIntl, InjectedIntlProps } from 'react-intl';

export {
Expand All @@ -20,7 +21,7 @@ export {
FormattedMessage,
FormattedHTMLMessage,
// Only used for testing. Use I18nProvider otherwise.
IntlProvider as __IntlProvider,
IntlProvider as __IntlProvider, // eslint-disable-next-line @kbn/eslint/module_migration
} from 'react-intl';

export { I18nProvider } from './provider';
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-i18n/src/react/inject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
* More docs and examples can be found here https://github.com/yahoo/react-intl/wiki/API#injection-api
*/

// eslint-disable-next-line @kbn/eslint/module_migration
export { injectIntl as injectI18n } from 'react-intl';
48 changes: 48 additions & 0 deletions packages/kbn-test-subj-selector/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")

PKG_BASE_NAME = "kbn-test-subj-selector"
PKG_REQUIRE_NAME = "@kbn/test-subj-selector"

SOURCE_FILES = glob([
"index.d.ts",
"index.js"
])

SRCS = SOURCE_FILES

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

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

DEPS = []

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"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export class KibanaMigrator {
migrationVersionPerType: this.documentMigrator.migrationVersion,
indexPrefix: index,
migrationsConfig: this.soMigrationsConfig,
typeRegistry: this.typeRegistry,
});
},
};
Expand Down
Loading

0 comments on commit 34b2cd5

Please sign in to comment.