Skip to content

Commit 5e220b8

Browse files
committed
Merge commit 'c974f56e1ca9ddd0c5f0460fd2737ae8c580716f' into lens/dnd_to_reorder
2 parents f2f19e4 + c974f56 commit 5e220b8

937 files changed

Lines changed: 72379 additions & 53168 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
/x-pack/build
1414
node_modules
1515
target
16+
snapshots.js
1617

1718
!/.eslintrc.js
1819

@@ -22,7 +23,6 @@ target
2223
/src/plugins/data/common/es_query/kuery/ast/_generated_/**
2324
/src/plugins/vis_type_timelion/public/_generated_/**
2425
/x-pack/legacy/plugins/**/__tests__/fixtures/**
25-
/x-pack/plugins/apm/e2e/**/snapshots.js
2626
/x-pack/plugins/apm/e2e/tmp/*
2727
/x-pack/plugins/canvas/canvas_plugin
2828
/x-pack/plugins/canvas/shareable_runtime/build

.eslintrc.js

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ module.exports = {
447447
{
448448
devDependencies: false,
449449
peerDependencies: true,
450+
packageDir: '.',
450451
},
451452
],
452453
},
@@ -478,6 +479,7 @@ module.exports = {
478479
{
479480
devDependencies: true,
480481
peerDependencies: true,
482+
packageDir: '.',
481483
},
482484
],
483485
},
@@ -732,22 +734,6 @@ module.exports = {
732734
},
733735
},
734736

735-
/**
736-
* ML overrides
737-
*/
738-
{
739-
files: ['x-pack/plugins/ml/**/*.js'],
740-
rules: {
741-
'no-shadow': 'error',
742-
'import/no-extraneous-dependencies': [
743-
'error',
744-
{
745-
packageDir: './x-pack',
746-
},
747-
],
748-
},
749-
},
750-
751737
/**
752738
* Security Solution overrides
753739
*/
@@ -1149,16 +1135,11 @@ module.exports = {
11491135
{
11501136
devDependencies: true,
11511137
peerDependencies: true,
1138+
packageDir: '.',
11521139
},
11531140
],
11541141
},
11551142
},
1156-
{
1157-
files: ['x-pack/plugins/canvas/storybook/**'],
1158-
rules: {
1159-
'import/no-extraneous-dependencies': 0,
1160-
},
1161-
},
11621143
{
11631144
files: ['x-pack/plugins/canvas/canvas_plugin_src/**/*.js'],
11641145
globals: { canvas: true, $: true },
@@ -1237,5 +1218,21 @@ module.exports = {
12371218
],
12381219
},
12391220
},
1221+
1222+
/**
1223+
* Single package.json rules, it tells eslint to ignore the child package.json files
1224+
* and look for dependencies declarations in the single and root level package.json
1225+
*/
1226+
{
1227+
files: ['**/*.{js,mjs,ts,tsx}'],
1228+
rules: {
1229+
'import/no-extraneous-dependencies': [
1230+
'error',
1231+
{
1232+
packageDir: '.',
1233+
},
1234+
],
1235+
},
1236+
},
12401237
],
12411238
};

.github/CODEOWNERS

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
/src/plugins/expressions/ @elastic/kibana-app-arch
6161
/src/plugins/inspector/ @elastic/kibana-app-arch
6262
/src/plugins/kibana_react/ @elastic/kibana-app-arch
63-
/src/plugins/kibana_react/public/code_editor @elastic/kibana-canvas
63+
/src/plugins/kibana_react/public/code_editor @elastic/kibana-presentation
6464
/src/plugins/kibana_utils/ @elastic/kibana-app-arch
6565
/src/plugins/navigation/ @elastic/kibana-app-arch
6666
/src/plugins/share/ @elastic/kibana-app-arch
@@ -104,19 +104,19 @@
104104
/x-pack/legacy/plugins/beats_management/ @elastic/beats
105105
#CC# /x-pack/plugins/beats_management/ @elastic/beats
106106

107-
# Canvas
108-
/src/plugins/dashboard/ @elastic/kibana-canvas
109-
/src/plugins/input_control_vis/ @elastic/kibana-canvas
110-
/src/plugins/vis_type_markdown/ @elastic/kibana-canvas
111-
/x-pack/plugins/canvas/ @elastic/kibana-canvas
112-
/x-pack/plugins/dashboard_enhanced/ @elastic/kibana-canvas
113-
/x-pack/test/functional/apps/canvas/ @elastic/kibana-canvas
114-
#CC# /src/legacy/core_plugins/kibana/public/dashboard/ @elastic/kibana-canvas
115-
#CC# /src/legacy/core_plugins/input_control_vis @elastic/kibana-canvas
116-
#CC# /src/plugins/kibana_react/public/code_editor/ @elastic/kibana-canvas
117-
#CC# /x-pack/legacy/plugins/canvas/ @elastic/kibana-canvas
118-
#CC# /x-pack/plugins/dashboard_mode @elastic/kibana-canvas
119-
#CC# /x-pack/legacy/plugins/dashboard_mode/ @elastic/kibana-canvas
107+
# Presentation
108+
/src/plugins/dashboard/ @elastic/kibana-presentation
109+
/src/plugins/input_control_vis/ @elastic/kibana-presentation
110+
/src/plugins/vis_type_markdown/ @elastic/kibana-presentation
111+
/x-pack/plugins/canvas/ @elastic/kibana-presentation
112+
/x-pack/plugins/dashboard_enhanced/ @elastic/kibana-presentation
113+
/x-pack/test/functional/apps/canvas/ @elastic/kibana-presentation
114+
#CC# /src/legacy/core_plugins/kibana/public/dashboard/ @elastic/kibana-presentation
115+
#CC# /src/legacy/core_plugins/input_control_vis @elastic/kibana-presentation
116+
#CC# /src/plugins/kibana_react/public/code_editor/ @elastic/kibana-presentation
117+
#CC# /x-pack/legacy/plugins/canvas/ @elastic/kibana-presentation
118+
#CC# /x-pack/plugins/dashboard_mode @elastic/kibana-presentation
119+
#CC# /x-pack/legacy/plugins/dashboard_mode/ @elastic/kibana-presentation
120120

121121
# Core UI
122122
# Exclude tutorials folder for now because they are not owned by Kibana app and most will move out soon
@@ -196,12 +196,15 @@
196196

197197
# Platform
198198
/src/core/ @elastic/kibana-platform
199+
/src/plugins/saved_objects_tagging_oss @elastic/kibana-platform
199200
/config/kibana.yml @elastic/kibana-platform
200201
/x-pack/plugins/features/ @elastic/kibana-platform
201202
/x-pack/plugins/licensing/ @elastic/kibana-platform
202203
/x-pack/plugins/global_search/ @elastic/kibana-platform
203204
/x-pack/plugins/cloud/ @elastic/kibana-platform
205+
/x-pack/plugins/saved_objects_tagging/ @elastic/kibana-platform
204206
/x-pack/test/saved_objects_field_count/ @elastic/kibana-platform
207+
/x-pack/test/saved_object_tagging/ @elastic/kibana-platform
205208
/packages/kbn-config-schema/ @elastic/kibana-platform
206209
/packages/kbn-std/ @elastic/kibana-platform
207210
/src/legacy/server/config/ @elastic/kibana-platform

.github/workflows/pr-project-assigner.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818

1919
# { "label": "Team:AppArch", "projectNumber": 37, "columnName": "Review in progress" },
2020
# { "label": "Feature:Lens", "projectNumber": 32, "columnName": "In progress" },
21-
# { "label": "Team:Canvas", "projectNumber": 38, "columnName": "Review in progress" }
21+
# { "label": "Feature:Canvas", "projectNumber": 38, "columnName": "Review in progress" }

.github/workflows/project-assigner.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
uses: elastic/github-actions/project-assigner@v2.0.0
1212
id: project_assigner
1313
with:
14-
issue-mappings: '[{"label": "Team:AppArch", "projectNumber": 37, "columnName": "To triage"}, {"label": "Feature:Lens", "projectNumber": 32, "columnName": "Long-term goals"}, {"label": "Team:Canvas", "projectNumber": 38, "columnName": "Inbox"}]'
14+
issue-mappings: '[{"label": "Team:AppArch", "projectNumber": 37, "columnName": "To triage"}, {"label": "Feature:Lens", "projectNumber": 32, "columnName": "Long-term goals"}, {"label": "Feature:Canvas", "projectNumber": 38, "columnName": "Inbox"}, {"label": "Feature:Dashboard", "projectNumber": 68, "columnName": "Inbox"}, {"label": "Feature:Drilldowns", "projectNumber": 68, "columnName": "Inbox"}]'
1515
ghToken: ${{ secrets.PROJECT_ASSIGNER_TOKEN }}
1616

1717

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ npm-debug.log*
5656
# apm plugin
5757
/x-pack/plugins/apm/tsconfig.json
5858
apm.tsconfig.json
59+
## @cypress/snapshot from apm plugin
60+
snapshots.js
5961

6062
# release notes script output
6163
report.csv

.yarnrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

NOTICE.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ This module was heavily inspired by the externals plugin that ships with webpack
2626
MIT License http://www.opensource.org/licenses/mit-license.php
2727
Author Tobias Koppers @sokra
2828

29+
---
30+
This product has relied on ASTExplorer that is licensed under MIT.
31+
2932
---
3033
This product includes code that is based on Ace editor, which was available
3134
under a "BSD" license.

docs/developer/contributing/development-ci-metrics.asciidoc

Lines changed: 77 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
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.
55

6+
* <<ci-metric-types>>
7+
* <<ci-metric-resolving-overages>>
8+
* <<ci-metric-validating-limits>>
9+
610

711
[[ci-metric-types]]
812
=== Metric types
@@ -16,7 +20,7 @@ These metrics help contributors know how they are impacting the size of the bund
1620
[[ci-metric-page-load-bundle-size]] `page load bundle size` ::
1721
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()`].
1822
+
19-
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.
23+
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.
2024

2125
[[ci-metric-async-chunks-size]] `async chunks size` ::
2226
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.
@@ -44,7 +48,7 @@ The number of files included in the default distributable.
4448
The number of files included in the OSS distributable.
4549

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

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

65-
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].
69+
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].
70+
71+
[[ci-metric-resolving-overages]]
72+
=== Resolving `page load bundle size` overages
73+
74+
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.
75+
76+
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:
77+
78+
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].
79+
+
80+
[source,shell]
81+
-----------
82+
node scripts/build_kibana_platform_plugins --focus {pluginid} --profile
83+
# builds and creates {pluginDir}target/public/stats.json files for {pluginId} and any plugin it depends on
84+
-----------
85+
86+
- Official Webpack tool: http://webpack.github.io/analyse/
87+
- Webpack visualizer: https://chrisbateman.github.io/webpack-visualizer/
88+
89+
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).
90+
91+
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]
92+
93+
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]:
94+
+
95+
[source,shell]
96+
-----------
97+
jq -r .modules[].id {pluginDir}/target/public/stats.json | sort - > moduleids.txt
98+
-----------
99+
+
100+
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.
101+
102+
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:
103+
+
104+
[source,shell]
105+
-----------
106+
node scripts/build_kibana_platform_plugins --focus {pluginId} --dist
107+
npm install -g prettier
108+
prettier -w {pluginDir}/target/public/{pluginId}.plugin.js
109+
# repeat these steps for upstream and then compare the two {pluginId}.plugin.js files in Beyond Compare
110+
-----------
111+
112+
6. If all else fails reach out to Operations for help.
113+
114+
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].
115+
116+
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
117+
118+
[source,shell]
119+
-----------
120+
node scripts/build_kibana_platform_plugins --focus {pluginId} --update-limits
121+
-----------
122+
123+
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.
124+
125+
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!
126+
127+
[[ci-metric-validating-limits]]
128+
=== Validating `page load bundle size` limits
129+
130+
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.
131+
132+
If you have a pretty powerful dev machine, or the necessary patience/determination, you can validate the limits locally by running the following command:
133+
134+
[source,shell]
135+
-----------
136+
node scripts/build_kibana_platform_plugins --validate-limits
137+
-----------
138+
139+
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.

docs/developer/plugin-list.asciidoc

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,9 @@ management section itself.
147147
It also provides a stateful version of it on the start contract.
148148
149149
150-
|{kib-repo}blob/{branch}/src/plugins/newsfeed[newsfeed]
151-
|WARNING: Missing README.
150+
|{kib-repo}blob/{branch}/src/plugins/newsfeed/README.md[newsfeed]
151+
|The newsfeed plugin adds a NewsfeedNavButton to the top navigation bar and renders the content in the flyout.
152+
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.
152153
153154
154155
|{kib-repo}blob/{branch}/src/plugins/region_map/README.md[regionMap]
@@ -163,6 +164,11 @@ It also provides a stateful version of it on the start contract.
163164
|WARNING: Missing README.
164165
165166
167+
|{kib-repo}blob/{branch}/src/plugins/saved_objects_tagging_oss/README.md[savedObjectsTaggingOss]
168+
|Bridge plugin for consumption of the saved object tagging feature from
169+
oss plugins.
170+
171+
166172
|{kib-repo}blob/{branch}/src/plugins/security_oss/README.md[securityOss]
167173
|securityOss is responsible for educating users about Elastic's free security features,
168174
so they can properly protect the data within their clusters.
@@ -465,6 +471,10 @@ Elastic.
465471
|Welcome to the Kibana rollup plugin! This plugin provides Kibana support for Elasticsearch's rollup feature. Please refer to the Elasticsearch documentation to understand rollup indices and how to create rollup jobs.
466472
467473
474+
|{kib-repo}blob/{branch}/x-pack/plugins/saved_objects_tagging/README.md[savedObjectsTagging]
475+
|Add tagging capability to saved objects
476+
477+
468478
|{kib-repo}blob/{branch}/x-pack/plugins/searchprofiler/README.md[searchprofiler]
469479
|The search profiler consumes the Profile API
470480
by sending a search API with profile: true enabled in the request body. The response contains
@@ -508,8 +518,9 @@ routes, etc.
508518
|This plugin provides access to the transforms features provided by Elastic.
509519
510520
511-
|{kib-repo}blob/{branch}/x-pack/plugins/translations[translations]
512-
|WARNING: Missing README.
521+
|<<translations-plugin>>
522+
|Contains Elastic-supported translations. Owned by the Localizations team.
523+
For adding localizations and instrument a ui to support translated content, see https://github.com/elastic/kibana/tree/master/packages/kbn-i18n
513524
514525
515526
|{kib-repo}blob/{branch}/x-pack/plugins/triggers_actions_ui/README.md[triggersActionsUi]
@@ -551,3 +562,4 @@ include::{kibana-root}/src/plugins/expressions/README.asciidoc[leveloffset=+1]
551562
include::{kibana-root}/src/plugins/ui_actions/README.asciidoc[leveloffset=+1]
552563
include::{kibana-root}/x-pack/plugins/dashboard_enhanced/README.asciidoc[leveloffset=+1]
553564
include::{kibana-root}/x-pack/plugins/embeddable_enhanced/README.asciidoc[leveloffset=+1]
565+
include::{kibana-root}/x-pack/plugins/translations/README.asciidoc[leveloffset=+1]

0 commit comments

Comments
 (0)