Skip to content

Commit

Permalink
Merge branch 'master' into 82823-infra-header-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Dec 8, 2020
2 parents a506be2 + 6858562 commit 1d26457
Show file tree
Hide file tree
Showing 2,696 changed files with 93,419 additions and 44,228 deletions.
2 changes: 1 addition & 1 deletion .ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# NOTE: This Dockerfile is ONLY used to run certain tasks in CI. It is not used to run Kibana or as a distributable.
# If you're looking for the Kibana Docker image distributable, please see: src/dev/build/tasks/os_packages/docker_generator/templates/dockerfile.template.ts

ARG NODE_VERSION=12.19.1
ARG NODE_VERSION=14.15.1

FROM node:${NODE_VERSION} AS base

Expand Down
8 changes: 0 additions & 8 deletions .ci/teamcity/tests/xpack_list_cyclic_dependency.sh

This file was deleted.

8 changes: 0 additions & 8 deletions .ci/teamcity/tests/xpack_siem_cyclic_dependency.sh

This file was deleted.

1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ snapshots.js
/packages/kbn-ui-framework/doc_site/build
/packages/kbn-ui-framework/generator-kui/*/templates/
/packages/kbn-ui-shared-deps/flot_charts
/packages/kbn-monaco/src/painless/antlr
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.19.1
14.15.1
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.19.1
14.15.1
2 changes: 0 additions & 2 deletions .teamcity/src/builds/test/QuickTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ object QuickTests : BuildType({

val testScripts = mapOf(
"Test Hardening" to ".ci/teamcity/tests/test_hardening.sh",
"X-Pack List cyclic dependency" to ".ci/teamcity/tests/xpack_list_cyclic_dependency.sh",
"X-Pack SIEM cyclic dependency" to ".ci/teamcity/tests/xpack_siem_cyclic_dependency.sh",
"Test Projects" to ".ci/teamcity/tests/test_projects.sh",
"Mocha Tests" to ".ci/teamcity/tests/mocha.sh"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ experimental[] Create a centrally-managed Logstash pipeline, or update an existi
[[logstash-configuration-management-api-create-request-body]]
==== Request body

`id`::
(Required, string) The pipeline ID.

`description`::
(Optional, string) The pipeline description.

Expand Down
20 changes: 15 additions & 5 deletions docs/api/spaces-management/copy_saved_objects.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,17 @@ You can request to overwrite any objects that already exist in the target space
(Optional, boolean) When set to `true`, all saved objects related to the specified saved objects will also be copied into the target
spaces. The default value is `false`.

`createNewCopies`::
(Optional, boolean) Creates new copies of saved objects, regenerates each object ID, and resets the origin. When used, potential conflict
errors are avoided. The default value is `true`.
+
NOTE: This cannot be used with the `overwrite` option.

`overwrite`::
(Optional, boolean) When set to `true`, all conflicts are automatically overidden. When a saved object with a matching `type` and `id`
exists in the target space, that version is replaced with the version from the source space. The default value is `false`.
+
NOTE: This cannot be used with the `createNewCopies` option.

[role="child_attributes"]
[[spaces-api-copy-saved-objects-response-body]]
Expand Down Expand Up @@ -128,8 +136,7 @@ $ curl -X POST api/spaces/_copy_saved_objects
"id": "my-dashboard"
}],
"spaces": ["marketing"],
"includeReferences": true,
"createNewcopies": true
"includeReferences": true
}
----
// KIBANA
Expand Down Expand Up @@ -193,7 +200,8 @@ $ curl -X POST api/spaces/_copy_saved_objects
"id": "my-dashboard"
}],
"spaces": ["marketing"],
"includeReferences": true
"includeReferences": true,
"createNewCopies": false
}
----
// KIBANA
Expand Down Expand Up @@ -254,7 +262,8 @@ $ curl -X POST api/spaces/_copy_saved_objects
"id": "my-dashboard"
}],
"spaces": ["marketing", "sales"],
"includeReferences": true
"includeReferences": true,
"createNewCopies": false
}
----
// KIBANA
Expand Down Expand Up @@ -405,7 +414,8 @@ $ curl -X POST api/spaces/_copy_saved_objects
"id": "my-dashboard"
}],
"spaces": ["marketing"],
"includeReferences": true
"includeReferences": true,
"createNewCopies": false
}
----
// KIBANA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ Execute the <<spaces-api-copy-saved-objects,copy saved objects to space API>>, w
`includeReferences`::
(Optional, boolean) When set to `true`, all saved objects related to the specified saved objects are copied into the target spaces. The `includeReferences` must be the same values used during the failed <<spaces-api-copy-saved-objects, copy saved objects to space API>> operation. The default value is `false`.

`createNewCopies`::
(Optional, boolean) Creates new copies of the saved objects, regenerates each object ID, and resets the origin. When enabled during the
initial copy, also enable when resolving copy errors. The default value is `true`.

`retries`::
(Required, object) The retry operations to attempt, which can specify how to resolve different types of errors. Object keys represent the
target space IDs.
Expand Down Expand Up @@ -148,6 +152,7 @@ $ curl -X POST api/spaces/_resolve_copy_saved_objects_errors
"id": "my-dashboard"
}],
"includeReferences": true,
"createNewCopies": false,
"retries": {
"sales": [
{
Expand Down Expand Up @@ -246,6 +251,7 @@ $ curl -X POST api/spaces/_resolve_copy_saved_objects_errors
"id": "my-dashboard"
}],
"includeReferences": true,
"createNewCopies": false,
"retries": {
"marketing": [
{
Expand Down
2 changes: 1 addition & 1 deletion docs/api/using-api.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ For all APIs, you must use a request header. The {kib} APIs support the `kbn-xsr
By default, you must use `kbn-xsrf` for all API calls, except in the following scenarios:

* The API endpoint uses the `GET` or `HEAD` operations
* The path is whitelisted using the <<settings-xsrf-whitelist, `server.xsrf.whitelist`>> setting
* The path is allowed using the <<settings-xsrf-allowlist, `server.xsrf.allowlist`>> setting
* XSRF protections are disabled using the <<settings-xsrf-disableProtection, `server.xsrf.disableProtection`>> setting

`Content-Type: application/json`::
Expand Down
2 changes: 1 addition & 1 deletion docs/apm/api.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ users interacting with APM APIs must have <<apm-app-api-user,sufficient privileg
By default, you must use `kbn-xsrf` for all API calls, except in the following scenarios:

* The API endpoint uses the `GET` or `HEAD` operations
* The path is whitelisted using the <<settings-xsrf-whitelist, `server.xsrf.whitelist`>> setting
* The path is allowed using the <<settings-xsrf-allowlist, `server.xsrf.allowlist`>> setting
* XSRF protections are disabled using the <<settings-xsrf-disableProtection, `server.xsrf.disableProtection`>> setting

`Content-Type: application/json`::
Expand Down
6 changes: 4 additions & 2 deletions docs/developer/contributing/development-unit-tests.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ yarn test:mocha
== Jest
Jest tests are stored in the same directory as source code files with the `.test.{js,mjs,ts,tsx}` suffix.

*Running Jest Unit Tests*
Each plugin and package contains it's own `jest.config.js` file to define its root, and any overrides
to the jest-preset provided by `@kbn/test`. When working on a single plugin or package, you will find
it's more efficient to supply the Jest configuration file when running.

["source","shell"]
-----------
yarn test:jest
yarn jest --config src/plugins/discover/jest.config.js
-----------

[discrete]
Expand Down
87 changes: 80 additions & 7 deletions docs/developer/getting-started/debugging.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@ For information about how to debug unit tests, refer to <<debugging-unit-tests>>
https://github.com/elastic/apm-agent-nodejs[Elastic APM Node.js Agent]
built-in for debugging purposes.

Its default configuration is meant to be used by core {kib} developers
With an application as varied and complex as Kibana has become, it's not practical or scalable to craft all possible performance measurements by hand ahead of time. As such, we need to rely on tooling to help us catch things we may otherwise have missed.

For example, say you implement a brand new feature, plugin or service but don't quite know how it will impact Kibana's performance as a whole. APM allows us to not only spot that something is slow, but also hints at why it might be performing slowly. For example, if a function is slow on specific types of inputs, we can see where the time is spent by viewing the trace for that function call in the APM UI.

image::images/apm_example_trace.png[]

The net of metrics captured by APM are both a wide and deep because the entire application is instrumented at runtime and we simply take a sample of these metrics. This means that we don't have to know what we need to measure ahead of time, we'll instead just get (most) of the data we're likely going to need by default.

This type of data can help us identify unknown bottlenecks, spot when a performance regression may have been introduced, and inform how the performance of Kibana is changing between releases. Using APM allows us to be proactive in getting ahead of potential performance regressions before they are released.

The default APM configuration is meant to be used by core {kib} developers
only, but it can easily be re-configured to your needs. In its default
configuration it’s disabled and will, once enabled, send APM data to a
centrally managed {es} cluster accessible only to Elastic
Expand All @@ -27,11 +37,8 @@ APM config option. To activate the APM agent, use the
https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuration.html#active[`active`]
APM config option.

All config options can be set either via environment variables, or by
creating an appropriate config file under `config/apm.dev.js`. For
more information about configuring the APM agent, please refer to
https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuring-the-agent.html[the
documentation].
All config options can be set by
creating an appropriate config file under `config/apm.dev.js`.

Example `config/apm.dev.js` file:

Expand All @@ -56,4 +63,70 @@ ELASTIC_APM_ACTIVE=true yarn start
Once the agent is active, it will trace all incoming HTTP requests to
{kib}, monitor for errors, and collect process-level metrics. The
collected data will be sent to the APM Server and is viewable in the APM
UI in {kib}.
UI in {kib}.

[discrete]
=== Running Kibana with the APM Agent Locally

The easiest and recommended way of running Kibana with the APM agent locally is to use the solution provided by the https://github.com/elastic/apm-integration-testing[apm-integration-testing] repo. You’ll need https://www.docker.com/community-edition[Docker] and https://docs.docker.com/compose/install/[Docker Compose] to use the tool.

[discrete]
==== Quick start guide

. Clone the https://github.com/elastic/apm-integration-testing[elastic/apm-integration-testing] repo.
. Change into the apm-integration-testing repo:
+
[source,bash]
----
cd apm-integration-testing
----

. Run {es} and the APM servers without running Kibana:
+
[source,bash]
----
./scripts/compose.py start master --no-kibana
----

. Change into the {kib} repo:
+
[source,bash]
----
cd ../kibana
----

. Change the elasticsearch credentials in your `kibana.yml` configuration file to match those needed by elasticsearch and the APM server (see the apm-integration-testing repo's https://github.com/elastic/apm-integration-testing#logging-in[README] for users provided to test different scenarios).
. Make sure that the APM agent is active and points to the local APM server by adding the following configuration settings to to a config file under `config/apm.dev.js`:
+
Example `config/apm.dev.js` file:
+
[source,js]
----
module.exports = {
active: true,
serverUrl: 'http://127.0.0.1:8200', // supports `http://localhost:8200`
centralConfig: false,
breakdownMetrics: false,
transactionSampleRate: 0.1,
metricsInterval: '120s'
};
----

. Start Kibana with APM active using:
+
[source,bash]
----
yarn start
----

. After Kibana starts up, navigate to the APM app, where you should see some transactions.

image::images/apm_ui_transactions.png[]

You can now continue doing what you want to in Kibana (e.g. install sample data sets, issue queries in dashboards, build new visualizations etc).
Once you're finished, you can stop Kibana normally, then stop the {es} and APM servers in the apm-integration-testing clone with the following script:

[source,bash]
----
./scripts/compose.py stop
----
14 changes: 14 additions & 0 deletions docs/developer/getting-started/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,20 @@ View all available options by running `yarn start --help`

Read about more advanced options for <<running-kibana-advanced>>.

[discrete]
=== Install pre-commit hook (optional)

In case you want to run a couple of checks like linting or check the file casing of the files to commit, we provide
a way to install a pre-commit hook. To configure it you just need to run the following:

[source,bash]
----
node scripts/register_git_hook
----

After the script completes the pre-commit hook will be created within the file `.git/hooks/pre-commit`.
If you choose to not install it, don't worry, we still run a quick ci check to provide feedback earliest as we can about the same checks.

[discrete]
=== Code away!

Expand Down
Binary file added docs/developer/images/apm_example_trace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/developer/images/apm_ui_transactions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,8 @@ Kibana.
|or
|{kib-repo}blob/{branch}/x-pack/plugins/spaces[spaces]
|WARNING: Missing README.
|{kib-repo}blob/{branch}/x-pack/plugins/spaces/README.md[spaces]
|See Configuring Kibana Spaces.
|{kib-repo}blob/{branch}/x-pack/plugins/stack_alerts/README.md[stackAlerts]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [OverlayFlyoutOpenOptions](./kibana-plugin-core-public.overlayflyoutopenoptions.md) &gt; [maxWidth](./kibana-plugin-core-public.overlayflyoutopenoptions.maxwidth.md)

## OverlayFlyoutOpenOptions.maxWidth property

<b>Signature:</b>

```typescript
maxWidth?: boolean | number | string;
```
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ export interface OverlayFlyoutOpenOptions
| ["data-test-subj"](./kibana-plugin-core-public.overlayflyoutopenoptions._data-test-subj_.md) | <code>string</code> | |
| [className](./kibana-plugin-core-public.overlayflyoutopenoptions.classname.md) | <code>string</code> | |
| [closeButtonAriaLabel](./kibana-plugin-core-public.overlayflyoutopenoptions.closebuttonarialabel.md) | <code>string</code> | |
| [maxWidth](./kibana-plugin-core-public.overlayflyoutopenoptions.maxwidth.md) | <code>boolean &#124; number &#124; string</code> | |
| [ownFocus](./kibana-plugin-core-public.overlayflyoutopenoptions.ownfocus.md) | <code>boolean</code> | |
| [size](./kibana-plugin-core-public.overlayflyoutopenoptions.size.md) | <code>EuiFlyoutSize</code> | |

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

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [OverlayFlyoutOpenOptions](./kibana-plugin-core-public.overlayflyoutopenoptions.md) &gt; [size](./kibana-plugin-core-public.overlayflyoutopenoptions.size.md)

## OverlayFlyoutOpenOptions.size property

<b>Signature:</b>

```typescript
size?: EuiFlyoutSize;
```
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface UiSettingsParams<T = unknown>
| [category](./kibana-plugin-core-public.uisettingsparams.category.md) | <code>string[]</code> | used to group the configured setting in the UI |
| [deprecation](./kibana-plugin-core-public.uisettingsparams.deprecation.md) | <code>DeprecationSettings</code> | optional deprecation information. Used to generate a deprecation warning. |
| [description](./kibana-plugin-core-public.uisettingsparams.description.md) | <code>string</code> | description provided to a user in UI |
| [metric](./kibana-plugin-core-public.uisettingsparams.metric.md) | <code>{</code><br/><code> type: UiStatsMetricType;</code><br/><code> name: string;</code><br/><code> }</code> | Metric to track once this property changes |
| [metric](./kibana-plugin-core-public.uisettingsparams.metric.md) | <code>{</code><br/><code> type: UiCounterMetricType;</code><br/><code> name: string;</code><br/><code> }</code> | Metric to track once this property changes |
| [name](./kibana-plugin-core-public.uisettingsparams.name.md) | <code>string</code> | title in the UI |
| [optionLabels](./kibana-plugin-core-public.uisettingsparams.optionlabels.md) | <code>Record&lt;string, string&gt;</code> | text labels for 'select' type UI element |
| [options](./kibana-plugin-core-public.uisettingsparams.options.md) | <code>string[]</code> | array of permitted values for this setting |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Metric to track once this property changes

```typescript
metric?: {
type: UiStatsMetricType;
type: UiCounterMetricType;
name: string;
};
```
1 change: 1 addition & 0 deletions docs/development/core/server/kibana-plugin-core-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [SavedObjectsImportSuccess](./kibana-plugin-core-server.savedobjectsimportsuccess.md) | Represents a successful import. |
| [SavedObjectsImportUnknownError](./kibana-plugin-core-server.savedobjectsimportunknownerror.md) | Represents a failure to import due to an unknown reason. |
| [SavedObjectsImportUnsupportedTypeError](./kibana-plugin-core-server.savedobjectsimportunsupportedtypeerror.md) | Represents a failure to import due to having an unsupported saved object type. |
| [SavedObjectsIncrementCounterField](./kibana-plugin-core-server.savedobjectsincrementcounterfield.md) | |
| [SavedObjectsIncrementCounterOptions](./kibana-plugin-core-server.savedobjectsincrementcounteroptions.md) | |
| [SavedObjectsMappingProperties](./kibana-plugin-core-server.savedobjectsmappingproperties.md) | Describe the fields of a [saved object type](./kibana-plugin-core-server.savedobjectstypemappingdefinition.md)<!-- -->. |
| [SavedObjectsMigrationLogger](./kibana-plugin-core-server.savedobjectsmigrationlogger.md) | |
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; [SavedObjectsIncrementCounterField](./kibana-plugin-core-server.savedobjectsincrementcounterfield.md) &gt; [fieldName](./kibana-plugin-core-server.savedobjectsincrementcounterfield.fieldname.md)

## SavedObjectsIncrementCounterField.fieldName property

The field name to increment the counter by.

<b>Signature:</b>

```typescript
fieldName: string;
```
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; [SavedObjectsIncrementCounterField](./kibana-plugin-core-server.savedobjectsincrementcounterfield.md) &gt; [incrementBy](./kibana-plugin-core-server.savedobjectsincrementcounterfield.incrementby.md)

## SavedObjectsIncrementCounterField.incrementBy property

The number to increment the field by (defaults to 1).

<b>Signature:</b>

```typescript
incrementBy?: number;
```
Loading

0 comments on commit 1d26457

Please sign in to comment.