Skip to content

Commit

Permalink
Merge branch 'feature/runtime-field-editor' into runtime-fields/flyou…
Browse files Browse the repository at this point in the history
…t-component
  • Loading branch information
kibanamachine authored Nov 3, 2020
2 parents 56ab2bc + 2cf52e1 commit af0c638
Show file tree
Hide file tree
Showing 1,140 changed files with 57,105 additions and 56,228 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/x-pack/build
node_modules
target
snapshots.js

!/.eslintrc.js

Expand All @@ -22,7 +23,6 @@ target
/src/plugins/data/common/es_query/kuery/ast/_generated_/**
/src/plugins/vis_type_timelion/public/_generated_/**
/x-pack/legacy/plugins/**/__tests__/fixtures/**
/x-pack/plugins/apm/e2e/**/snapshots.js
/x-pack/plugins/apm/e2e/tmp/*
/x-pack/plugins/canvas/canvas_plugin
/x-pack/plugins/canvas/shareable_runtime/build
Expand Down
41 changes: 19 additions & 22 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ module.exports = {
{
devDependencies: false,
peerDependencies: true,
packageDir: '.',
},
],
},
Expand Down Expand Up @@ -478,6 +479,7 @@ module.exports = {
{
devDependencies: true,
peerDependencies: true,
packageDir: '.',
},
],
},
Expand Down Expand Up @@ -732,22 +734,6 @@ module.exports = {
},
},

/**
* ML overrides
*/
{
files: ['x-pack/plugins/ml/**/*.js'],
rules: {
'no-shadow': 'error',
'import/no-extraneous-dependencies': [
'error',
{
packageDir: './x-pack',
},
],
},
},

/**
* Security Solution overrides
*/
Expand Down Expand Up @@ -1149,16 +1135,11 @@ module.exports = {
{
devDependencies: true,
peerDependencies: true,
packageDir: '.',
},
],
},
},
{
files: ['x-pack/plugins/canvas/storybook/**'],
rules: {
'import/no-extraneous-dependencies': 0,
},
},
{
files: ['x-pack/plugins/canvas/canvas_plugin_src/**/*.js'],
globals: { canvas: true, $: true },
Expand Down Expand Up @@ -1237,5 +1218,21 @@ module.exports = {
],
},
},

/**
* Single package.json rules, it tells eslint to ignore the child package.json files
* and look for dependencies declarations in the single and root level package.json
*/
{
files: ['**/*.{js,mjs,ts,tsx}'],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
packageDir: '.',
},
],
},
},
],
};
6 changes: 1 addition & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@
#CC# /src/legacy/core_plugins/vis_type_vislib/ @elastic/kibana-app
#CC# /src/legacy/server/url_shortening/ @elastic/kibana-app
#CC# /src/legacy/ui/public/state_management @elastic/kibana-app
#CC# /src/plugins/advanced_settings/ @elastic/kibana-app
#CC# /src/plugins/charts/ @elastic/kibana-app
#CC# /src/plugins/index_pattern_management/public @elastic/kibana-app
#CC# /src/plugins/vis_default_editor @elastic/kibana-app

# App Architecture
/examples/bfetch_explorer/ @elastic/kibana-app-arch
Expand Down Expand Up @@ -74,7 +70,7 @@
/x-pack/plugins/embeddable_enhanced/ @elastic/kibana-app-arch
/x-pack/plugins/ui_actions_enhanced/ @elastic/kibana-app-arch
#CC# /src/plugins/bfetch/ @elastic/kibana-app-arch
#CC# /src/plugins/index_pattern_management/public/service @elastic/kibana-app-arch
#CC# /src/plugins/index_pattern_management/ @elastic/kibana-app-arch
#CC# /src/plugins/inspector/ @elastic/kibana-app-arch
#CC# /src/plugins/share/ @elastic/kibana-app-arch
#CC# /x-pack/plugins/advanced_ui_actions/ @elastic/kibana-app-arch
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ npm-debug.log*
# apm plugin
/x-pack/plugins/apm/tsconfig.json
apm.tsconfig.json
## @cypress/snapshot from apm plugin
snapshots.js

# release notes script output
report.csv
Expand Down
1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

3 changes: 3 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ This module was heavily inspired by the externals plugin that ships with webpack
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra

---
This product has relied on ASTExplorer that is licensed under MIT.

---
This product includes code that is based on Ace editor, which was available
under a "BSD" license.
Expand Down
4 changes: 2 additions & 2 deletions docs/api/saved-objects/rotate_encryption_key.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Bulk key rotation can consume a considerable amount of resources and hence only
`type`::
(Optional, string) Limits encryption key rotation only to the saved objects with the specified type. By default, {kib} tries to rotate the encryption key for all saved object types that may contain encrypted attributes.

`batchSize`::
`batch_size`::
(Optional, number) Specifies a maximum number of saved objects that {kib} can process in a single batch. Bulk key rotation is an iterative process since {kib} may not be able to fetch and process all required saved objects in one go and splits processing into consequent batches. By default, the batch size is 10000, which is also a maximum allowed value.

[[saved-objects-api-rotate-encryption-key-response-body]]
Expand Down Expand Up @@ -91,7 +91,7 @@ In this example, key rotation is performed for all saved objects with the `alert

[source,sh]
--------------------------------------------------
$ curl -X POST /api/encrypted_saved_objects/_rotate_key?type=alert&batchSize=5000
$ curl -X POST /api/encrypted_saved_objects/_rotate_key?type=alert&batch_size=5000
--------------------------------------------------
// KIBANA

Expand Down
80 changes: 77 additions & 3 deletions docs/developer/contributing/development-ci-metrics.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

In addition to running our tests, CI collects metrics about the Kibana build. These metrics are sent to an external service to track changes over time, and to provide PR authors insights into the impact of their changes.

* <<ci-metric-types>>
* <<ci-metric-resolving-overages>>
* <<ci-metric-validating-limits>>


[[ci-metric-types]]
=== Metric types
Expand All @@ -16,7 +20,7 @@ These metrics help contributors know how they are impacting the size of the bund
[[ci-metric-page-load-bundle-size]] `page load bundle size` ::
The size of the entry file produced for each bundle/plugin. This file is always loaded on every page load, so it should be as small as possible. To reduce this metric you can put any code that isn't necessary on every page load behind an https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Dynamic_Imports[`async import()`].
+
Code that is shared statically with other plugins will contribute to the `page load bundle size` of that plugin. This includes exports from the `public/index.ts` file and any file referenced by the `extraPublicDirs` manifest property.
Code that is shared statically with other plugins will contribute to the `page load bundle size` of that plugin. This includes exports from the `public/index.ts` file and any file referenced by the `extraPublicDirs` manifest property.

[[ci-metric-async-chunks-size]] `async chunks size` ::
An "async chunk" is created for the files imported by each https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Dynamic_Imports[`async import()`] statement. This metric tracks the sum size of these chunks, in bytes, broken down by plugin/bundle id. You can think of this as the amount of code users will have to download if they access all the components/applications within a bundle.
Expand Down Expand Up @@ -44,7 +48,7 @@ The number of files included in the default distributable.
The number of files included in the OSS distributable.

[[ci-metric-distributable-size]] `distributable size` ::
The size, in bytes, of the default distributable. _(not reported on PRs)_
The size, in bytes, of the default distributable. _(not reported on PRs)_

[[ci-metric-oss-distributable-size]] `oss distributable size` ::
The size, in bytes, of the OSS distributable. _(not reported on PRs)_
Expand All @@ -62,4 +66,74 @@ The number of saved object fields broken down by saved object type.
[[ci-metric-adding-new-metrics]]
=== Adding new metrics

You can report new metrics by using the `CiStatsReporter` class provided by the `@kbn/dev-utils` package. This class is automatically configured on CI and its methods noop when running outside of CI. For more details checkout the {kib-repo}blob/{branch}/packages/kbn-dev-utils/src/ci_stats_reporter[`CiStatsReporter` readme].
You can report new metrics by using the `CiStatsReporter` class provided by the `@kbn/dev-utils` package. This class is automatically configured on CI and its methods noop when running outside of CI. For more details checkout the {kib-repo}blob/{branch}/packages/kbn-dev-utils/src/ci_stats_reporter[`CiStatsReporter` readme].

[[ci-metric-resolving-overages]]
=== Resolving `page load bundle size` overages

In order to prevent the page load bundles from growing unexpectedly large we limit the `page load asset size` metric for each plugin. When a PR increases this metric beyond the limit defined for that plugin in {kib-repo}blob/{branch}/packages/kbn-optimizer/limits.yml[`limits.yml`] a failed commit status is set and the PR author needs to decide how to resolve this issue before the PR can be merged.

In most cases the limit should be high enough that PRs shouldn't trigger overages, but when they do make sure it's clear what is cuasing the overage by trying the following:

1. Run the optimizer locally with the `--profile` flag to produce webpack `stats.json` files for bundles which can be inspected using a number of different online tools. Focus on the chunk named `{pluginId}.plugin.js`; the `*.chunk.js` chunks make up the `async chunks size` metric which is currently unlimited and is the main way that we {kib-repo}blob/{branch}/src/core/MIGRATION.md#keep-kibana-fast[reduce the size of page load chunks].
+
[source,shell]
-----------
node scripts/build_kibana_platform_plugins --focus {pluginid} --profile
# builds and creates {pluginDir}target/public/stats.json files for {pluginId} and any plugin it depends on
-----------

- Official Webpack tool: http://webpack.github.io/analyse/
- Webpack visualizer: https://chrisbateman.github.io/webpack-visualizer/

2. You might want to create stats for the upstream branch of your PR as well and then compare them side by side in Webpack visualizer to spot where the size difference is (using two browser tabs).

3. For relatively small changes you might be able to better understand the problem by sticking stats.json files from two different branches into https://www.scootersoftware.com/download.php[Beyond Compare]

4. If the number of changes in https://www.scootersoftware.com/download.php[Beyond Compare] are too large, you can reduce the stats.json file down to just a sorted list of module ids using https://github.com/stedolan/jq[jq]:
+
[source,shell]
-----------
jq -r .modules[].id {pluginDir}/target/public/stats.json | sort - > moduleids.txt
-----------
+
Produce a moduleids.txt file for both your branch and master and then pop them into Beyond Compare to get a very specific view of what's new.

5. As a last resort you might want to try comparing the bundle source directly. It's usually best to do this using the production source so that you're inspecting the actual change in bytes that CI is seeing. After building the distributable version of your bundle run it through prettier and then dropping it into Beyond Compare along with the chunk from upstream:
+
[source,shell]
-----------
node scripts/build_kibana_platform_plugins --focus {pluginId} --dist
npm install -g prettier
prettier -w {pluginDir}/target/public/{pluginId}.plugin.js
# repeat these steps for upstream and then compare the two {pluginId}.plugin.js files in Beyond Compare
-----------

6. If all else fails reach out to Operations for help.

Once you've identified the files which were added to the build you likely just need to stick them behind an async import as described in {kib-repo}blob/{branch}/src/core/MIGRATION.md#keep-kibana-fast[the MIGRATION.md docs].

In the case that the bundle size is not being bloated by anything obvious, but it's still larger than the limit, you can raise the limit in your PR. Do this either by editting the {kib-repo}blob/{branch}/packages/kbn-optimizer/limits.yml[`limits.yml` file] manually or by running the following to have the limit updated to the current size + 15kb

[source,shell]
-----------
node scripts/build_kibana_platform_plugins --focus {pluginId} --update-limits
-----------

This command has to run the optimizer in distributable mode so it will take a lot longer and spawn one worker for each CPU on your machine.

Changes to the {kib-repo}blob/{branch}/packages/kbn-optimizer/limits.yml[`limits.yml` file] will trigger review from the Operations team, who will attempt to verify that the size increase is justified. If you have findings you can share from the steps above that would be very helpful!

[[ci-metric-validating-limits]]
=== Validating `page load bundle size` limits

Once you've fixed any issues discovered while diagnosing overages you probably should just push the changes to your PR and let CI validate them.

If you have a pretty powerful dev machine, or the necessary patience/determination, you can validate the limits locally by running the following command:

[source,shell]
-----------
node scripts/build_kibana_platform_plugins --validate-limits
-----------

This command needs to apply production optimizations to get the right sizes, which means that the optimizer will take significantly longer to run and on most developmer machines will consume all of your machines resources for 20 minutes or more. If you'd like to multi-task while this is running you might need to limit the number of workers using the `--max-workers` flag.
23 changes: 15 additions & 8 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ NOTE:
|Description
|{kib-repo}blob/{branch}/src/plugins/advanced_settings[advancedSettings]
|WARNING: Missing README.
|{kib-repo}blob/{branch}/src/plugins/advanced_settings/README.md[advancedSettings]
|This plugin contains the advanced settings management section
allowing users to configure their advanced settings, also known
as uiSettings within the code.
|{kib-repo}blob/{branch}/src/plugins/apm_oss[apmOss]
Expand Down Expand Up @@ -130,8 +132,10 @@ in Kibana, e.g. visualizations. It has the form of a flyout panel.
|WARNING: Missing README.
|{kib-repo}blob/{branch}/src/plugins/management[management]
|WARNING: Missing README.
|{kib-repo}blob/{branch}/src/plugins/management/README.md[management]
|This plugins contains the "Stack Management" page framework. It offers navigation and an API
to link individual managment section into it. This plugin does not contain any individual
management section itself.
|{kib-repo}blob/{branch}/src/plugins/maps_legacy/README.md[mapsLegacy]
Expand All @@ -143,8 +147,9 @@ in Kibana, e.g. visualizations. It has the form of a flyout panel.
It also provides a stateful version of it on the start contract.
|{kib-repo}blob/{branch}/src/plugins/newsfeed[newsfeed]
|WARNING: Missing README.
|{kib-repo}blob/{branch}/src/plugins/newsfeed/README.md[newsfeed]
|The newsfeed plugin adds a NewsfeedNavButton to the top navigation bar and renders the content in the flyout.
Content is fetched from the remote (https://feeds.elastic.co and https://feeds-staging.elastic.co in dev mode) once a day, with periodic checks if the content needs to be refreshed. All newsfeed content is hosted remotely.
|{kib-repo}blob/{branch}/src/plugins/region_map/README.md[regionMap]
Expand Down Expand Up @@ -508,8 +513,9 @@ routes, etc.
|This plugin provides access to the transforms features provided by Elastic.
|{kib-repo}blob/{branch}/x-pack/plugins/translations[translations]
|WARNING: Missing README.
|<<translations-plugin>>
|Contains Elastic-supported translations. Owned by the Localizations team.
For adding localizations and instrument a ui to support translated content, see https://github.com/elastic/kibana/tree/master/packages/kbn-i18n
|{kib-repo}blob/{branch}/x-pack/plugins/triggers_actions_ui/README.md[triggersActionsUi]
Expand Down Expand Up @@ -551,3 +557,4 @@ include::{kibana-root}/src/plugins/expressions/README.asciidoc[leveloffset=+1]
include::{kibana-root}/src/plugins/ui_actions/README.asciidoc[leveloffset=+1]
include::{kibana-root}/x-pack/plugins/dashboard_enhanced/README.asciidoc[leveloffset=+1]
include::{kibana-root}/x-pack/plugins/embeddable_enhanced/README.asciidoc[leveloffset=+1]
include::{kibana-root}/x-pack/plugins/translations/README.asciidoc[leveloffset=+1]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- 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; [ChromeStart](./kibana-plugin-core-public.chromestart.md) &gt; [getBreadcrumbsAppendExtension$](./kibana-plugin-core-public.chromestart.getbreadcrumbsappendextension_.md)

## ChromeStart.getBreadcrumbsAppendExtension$() method

Get an observable of the current extension appended to breadcrumbs

<b>Signature:</b>

```typescript
getBreadcrumbsAppendExtension$(): Observable<ChromeBreadcrumbsAppendExtension | undefined>;
```
<b>Returns:</b>

`Observable<ChromeBreadcrumbsAppendExtension | undefined>`

Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ core.chrome.setHelpExtension(elem => {
| [getBadge$()](./kibana-plugin-core-public.chromestart.getbadge_.md) | Get an observable of the current badge |
| [getBrand$()](./kibana-plugin-core-public.chromestart.getbrand_.md) | Get an observable of the current brand information. |
| [getBreadcrumbs$()](./kibana-plugin-core-public.chromestart.getbreadcrumbs_.md) | Get an observable of the current list of breadcrumbs |
| [getBreadcrumbsAppendExtension$()](./kibana-plugin-core-public.chromestart.getbreadcrumbsappendextension_.md) | Get an observable of the current extension appended to breadcrumbs |
| [getCustomNavLink$()](./kibana-plugin-core-public.chromestart.getcustomnavlink_.md) | Get an observable of the current custom nav link |
| [getHelpExtension$()](./kibana-plugin-core-public.chromestart.gethelpextension_.md) | Get an observable of the current custom help conttent |
| [getIsNavDrawerLocked$()](./kibana-plugin-core-public.chromestart.getisnavdrawerlocked_.md) | Get an observable of the current locked state of the nav drawer. |
Expand All @@ -64,6 +65,7 @@ core.chrome.setHelpExtension(elem => {
| [setBadge(badge)](./kibana-plugin-core-public.chromestart.setbadge.md) | Override the current badge |
| [setBrand(brand)](./kibana-plugin-core-public.chromestart.setbrand.md) | Set the brand configuration. |
| [setBreadcrumbs(newBreadcrumbs)](./kibana-plugin-core-public.chromestart.setbreadcrumbs.md) | Override the current set of breadcrumbs |
| [setBreadcrumbsAppendExtension(breadcrumbsAppendExtension)](./kibana-plugin-core-public.chromestart.setbreadcrumbsappendextension.md) | Mount an element next to the last breadcrumb |
| [setCustomNavLink(newCustomNavLink)](./kibana-plugin-core-public.chromestart.setcustomnavlink.md) | Override the current set of custom nav link |
| [setHelpExtension(helpExtension)](./kibana-plugin-core-public.chromestart.sethelpextension.md) | Override the current set of custom help content |
| [setHelpSupportUrl(url)](./kibana-plugin-core-public.chromestart.sethelpsupporturl.md) | Override the default support URL shown in the help menu |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- 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; [ChromeStart](./kibana-plugin-core-public.chromestart.md) &gt; [setBreadcrumbsAppendExtension](./kibana-plugin-core-public.chromestart.setbreadcrumbsappendextension.md)

## ChromeStart.setBreadcrumbsAppendExtension() method

Mount an element next to the last breadcrumb

<b>Signature:</b>

```typescript
setBreadcrumbsAppendExtension(breadcrumbsAppendExtension?: ChromeBreadcrumbsAppendExtension): void;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| breadcrumbsAppendExtension | <code>ChromeBreadcrumbsAppendExtension</code> | |

<b>Returns:</b>

`void`

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ export interface ISearchSetup
| Property | Type | Description |
| --- | --- | --- |
| [aggs](./kibana-plugin-plugins-data-public.isearchsetup.aggs.md) | <code>AggsSetup</code> | |
| [session](./kibana-plugin-plugins-data-public.isearchsetup.session.md) | <code>ISessionService</code> | session management |
| [session](./kibana-plugin-plugins-data-public.isearchsetup.session.md) | <code>ISessionService</code> | session management [ISessionService](./kibana-plugin-plugins-data-public.isessionservice.md) |
| [usageCollector](./kibana-plugin-plugins-data-public.isearchsetup.usagecollector.md) | <code>SearchUsageCollector</code> | |

Loading

0 comments on commit af0c638

Please sign in to comment.