Skip to content

Commit 4722905

Browse files
Merge branch 'master' into endpoint_telemetry_cloned_vms
2 parents f513d5b + 6f2dc10 commit 4722905

File tree

1,826 files changed

+39412
-18109
lines changed

Some content is hidden

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

1,826 files changed

+39412
-18109
lines changed

.browserslistrc

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ last 2 Chrome versions
44
last 2 Safari versions
55
> 0.25%
66
not ie 11
7+
not op_mini all
8+
not samsung 4
79

810
[dev]
911
last 1 chrome versions

.github/CODEOWNERS

+2-17
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#CC# /src/legacy/core_plugins/vis_type_vislib/ @elastic/kibana-app
4040
#CC# /src/legacy/server/url_shortening/ @elastic/kibana-app
4141
#CC# /src/legacy/ui/public/state_management @elastic/kibana-app
42-
#CC# /src/plugins/index_pattern_management/public @elastic/kibana-app
4342

4443
# App Architecture
4544
/examples/bfetch_explorer/ @elastic/kibana-app-arch
@@ -70,23 +69,10 @@
7069
/x-pack/plugins/data_enhanced/ @elastic/kibana-app-arch
7170
/x-pack/plugins/embeddable_enhanced/ @elastic/kibana-app-arch
7271
/x-pack/plugins/ui_actions_enhanced/ @elastic/kibana-app-arch
73-
#CC# /src/legacy/core_plugins/kibana/public/management/ @elastic/kibana-app-arch
74-
#CC# /src/legacy/core_plugins/kibana/server/routes/api/management/ @elastic/kibana-app-arch
75-
#CC# /src/legacy/core_plugins/embeddable_api/ @elastic/kibana-app-arch
76-
#CC# /src/legacy/core_plugins/interpreter/ @elastic/kibana-app-arch
77-
#CC# /src/legacy/core_plugins/kibana_react/ @elastic/kibana-app-arch
78-
#CC# /src/legacy/core_plugins/status_page/public @elastic/kibana-app-arch
79-
#CC# /src/legacy/server/index_patterns/ @elastic/kibana-app-arch
80-
#CC# /src/legacy/ui/public/field_editor @elastic/kibana-app-arch
81-
#CC# /src/legacy/ui/public/management @elastic/kibana-app-arch
82-
#CC# /src/plugins/advanced_settings/ @elastic/kibana-app-arch
8372
#CC# /src/plugins/bfetch/ @elastic/kibana-app-arch
84-
#CC# /src/plugins/charts/ @elastic/kibana-app-arch
85-
#CC# /src/plugins/index_pattern_management/public/service @elastic/kibana-app-arch
73+
#CC# /src/plugins/index_pattern_management/ @elastic/kibana-app-arch
8674
#CC# /src/plugins/inspector/ @elastic/kibana-app-arch
87-
#CC# /src/plugins/saved_objects/ @elastic/kibana-app-arch
8875
#CC# /src/plugins/share/ @elastic/kibana-app-arch
89-
#CC# /src/plugins/vis_default_editor @elastic/kibana-app-arch
9076
#CC# /x-pack/plugins/advanced_ui_actions/ @elastic/kibana-app-arch
9177
#CC# /x-pack/plugins/drilldowns/ @elastic/kibana-app-arch
9278
#CC# /packages/kbn-interpreter/ @elastic/kibana-app-arch
@@ -171,8 +157,6 @@
171157
/x-pack/test/functional/apps/maps/ @elastic/kibana-gis
172158
/x-pack/test/functional/es_archives/maps/ @elastic/kibana-gis
173159
/x-pack/test/visual_regression/tests/maps/index.js @elastic/kibana-gis
174-
#CC# /src/legacy/core_plugins/region_map @elastic/kibana-gis
175-
#CC# /src/legacy/core_plugins/tile_map @elastic/kibana-gis
176160
#CC# /src/plugins/maps_legacy/ @elastic/kibana-gis
177161
#CC# /x-pack/plugins/file_upload @elastic/kibana-gis
178162
#CC# /x-pack/plugins/maps_legacy_licensing @elastic/kibana-gis
@@ -245,6 +229,7 @@
245229
#CC# /src/legacy/ui/public/documentation_links @elastic/kibana-platform
246230
#CC# /src/legacy/ui/public/autoload @elastic/kibana-platform
247231
#CC# /src/plugins/legacy_export/ @elastic/kibana-platform
232+
#CC# /src/plugins/saved_objects/ @elastic/kibana-platform
248233
#CC# /src/plugins/status_page/ @elastic/kibana-platform
249234
#CC# /src/plugins/testbed/server/ @elastic/kibana-platform
250235
#CC# /x-pack/legacy/plugins/xpack_main/server/ @elastic/kibana-platform

.github/ISSUE_TEMPLATE/v8_breaking_change.md

+10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ assignees: ''
77

88
---
99

10+
<!--
11+
****************************************
12+
******* LABEL CHANGES NECESSARY ********
13+
****************************************
14+
15+
Please add a "NeededFor:${TeamName}" label to denote the team that is
16+
requesting the breaking change is surfaced in the Upgrade Assistant.
17+
18+
-->
19+
1020
## Change description
1121

1222
**Which release will ship the breaking change?**

docs/api/saved-objects/rotate_encryption_key.asciidoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Bulk key rotation can consume a considerable amount of resources and hence only
2525
`type`::
2626
(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.
2727

28-
`batchSize`::
28+
`batch_size`::
2929
(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.
3030

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

9292
[source,sh]
9393
--------------------------------------------------
94-
$ curl -X POST /api/encrypted_saved_objects/_rotate_key?type=alert&batchSize=5000
94+
$ curl -X POST /api/encrypted_saved_objects/_rotate_key?type=alert&batch_size=5000
9595
--------------------------------------------------
9696
// KIBANA
9797

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

+77-3
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.

0 commit comments

Comments
 (0)