Skip to content

Commit 49b04da

Browse files
Merge branch 'master' into implement/release-note-dev-docs
2 parents 6151979 + 128485c commit 49b04da

File tree

1,739 files changed

+57945
-13625
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,739 files changed

+57945
-13625
lines changed

.backportrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"targetBranchChoices": [
44
{ "name": "master", "checked": true },
55
{ "name": "7.x", "checked": true },
6+
"7.10",
67
"7.9",
78
"7.8",
89
"7.7",
@@ -27,7 +28,7 @@
2728
"targetPRLabels": ["backport"],
2829
"branchLabelMapping": {
2930
"^v8.0.0$": "master",
30-
"^v7.10.0$": "7.x",
31+
"^v7.11.0$": "7.x",
3132
"^v(\\d+).(\\d+).\\d+$": "$1.$2"
3233
}
3334
}

.eslintrc.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,9 +1046,7 @@ module.exports = {
10461046
*/
10471047
{
10481048
// typescript only for front and back end
1049-
files: [
1050-
'x-pack/plugins/{alerts,alerting_builtins,actions,task_manager,event_log}/**/*.{ts,tsx}',
1051-
],
1049+
files: ['x-pack/plugins/{alerts,stack_alerts,actions,task_manager,event_log}/**/*.{ts,tsx}'],
10521050
rules: {
10531051
'@typescript-eslint/no-explicit-any': 'error',
10541052
},

.github/CODEOWNERS

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@
137137
/src/plugins/home/public @elastic/kibana-core-ui
138138
/src/plugins/home/server/*.ts @elastic/kibana-core-ui
139139
/src/plugins/home/server/services/ @elastic/kibana-core-ui
140+
/src/plugins/kibana_overview/ @elastic/kibana-core-ui
140141
/x-pack/plugins/global_search_bar/ @elastic/kibana-core-ui
141142
#CC# /src/legacy/core_plugins/newsfeed @elastic/kibana-core-ui
142143
#CC# /src/legacy/server/sample_data/ @elastic/kibana-core-ui
@@ -255,6 +256,8 @@
255256

256257
# Security
257258
/src/core/server/csp/ @elastic/kibana-security @elastic/kibana-platform
259+
/src/plugins/security_oss/ @elastic/kibana-security
260+
/test/security_functional/ @elastic/kibana-security
258261
/x-pack/plugins/spaces/ @elastic/kibana-security
259262
/x-pack/plugins/encrypted_saved_objects/ @elastic/kibana-security
260263
/x-pack/plugins/security/ @elastic/kibana-security
@@ -314,7 +317,7 @@ x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @elastic/kib
314317
#CC# /x-pack/legacy/plugins/alerting/ @elastic/kibana-alerting-services
315318
#CC# /x-pack/legacy/plugins/task_manager @elastic/kibana-alerting-services
316319
#CC# /x-pack/legacy/plugins/triggers_actions_ui/ @elastic/kibana-alerting-services
317-
#CC# /x-pack/plugins/alerting_builtins @elastic/kibana-alerting-services
320+
#CC# /x-pack/plugins/stack_alerts @elastic/kibana-alerting-services
318321

319322
# Enterprise Search
320323
# Shared

.i18nrc.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"indexPatternManagement": "src/plugins/index_pattern_management",
3030
"advancedSettings": "src/plugins/advanced_settings",
3131
"kibana_legacy": "src/plugins/kibana_legacy",
32+
"kibanaOverview": "src/plugins/kibana_overview",
3233
"kibana_react": "src/legacy/core_plugins/kibana_react",
3334
"kibana-react": "src/plugins/kibana_react",
3435
"kibana_utils": "src/plugins/kibana_utils",
@@ -37,6 +38,7 @@
3738
"regionMap": "src/plugins/region_map",
3839
"savedObjects": "src/plugins/saved_objects",
3940
"savedObjectsManagement": "src/plugins/saved_objects_management",
41+
"security": "src/plugins/security_oss",
4042
"server": "src/legacy/server",
4143
"statusPage": "src/legacy/core_plugins/status_page",
4244
"telemetry": [

docs/api/saved-objects/bulk_create.asciidoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ experimental[] Create multiple {kib} saved objects.
4141
`references`::
4242
(Optional, array) Objects with `name`, `id`, and `type` properties that describe the other saved objects in the referenced object. To refer to the other saved object, use `name` in the attributes. Never use `id` to refer to the other saved object. `id` can be automatically updated during migrations, import, or export.
4343

44-
`namespaces`::
45-
(Optional, string array) Identifiers for the <<xpack-spaces,spaces>> in which this object should be created. If this is not provided, the
46-
object will be created in the current space.
44+
`initialNamespaces`::
45+
(Optional, string array) Identifiers for the <<xpack-spaces,spaces>> in which this object is created. If this is provided, the
46+
object is created only in the explicitly defined spaces. If this is not provided, the object is created in the current space
47+
(default behavior).
4748

4849
`version`::
4950
(Optional, number) Specifies the version.

docs/api/saved-objects/create.asciidoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ any data that you send to the API is properly formed.
4646
`references`::
4747
(Optional, array) Objects with `name`, `id`, and `type` properties that describe the other saved objects that this object references. Use `name` in attributes to refer to the other saved object, but never the `id`, which can update automatically during migrations or import/export.
4848

49-
`namespaces`::
50-
(Optional, string array) Identifiers for the <<xpack-spaces,spaces>> in which this object should be created. If this is not provided, the
51-
object will be created in the current space.
49+
`initialNamespaces`::
50+
(Optional, string array) Identifiers for the <<xpack-spaces,spaces>> in which this object is created. If this is provided, the
51+
object is created only in the explicitly defined spaces. If this is not provided, the object is created in the current space
52+
(default behavior).
5253

5354
[[saved-objects-api-create-request-codes]]
5455
==== Response code

docs/developer/best-practices/index.asciidoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,12 @@ Review:
138138
* <<development-unit-tests>>
139139
* <<stability>>
140140
* <<security-best-practices>>
141+
* <<typescript>>
141142

142143
include::navigation.asciidoc[leveloffset=+1]
143144

144145
include::stability.asciidoc[leveloffset=+1]
145146

146147
include::security.asciidoc[leveloffset=+1]
148+
149+
include::typescript.asciidoc[leveloffset=+1]
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
[[typescript]]
2+
== Typescript
3+
4+
Although this is not a requirement, we encourage if all new code is developed in https://www.typescriptlang.org/[Typescript].
5+
6+
[discrete]
7+
=== Project references
8+
Kibana has crossed the 2m LoC mark. The current situation creates some scaling problems when the default out-of-the-box setup stops working. As a result, developers suffer from slow project compilation and IDE unresponsiveness. As a part of https://github.com/elastic/kibana/projects/63[Developer Experience project], we are migrating our tooling to use built-in TypeScript features addressing the scaling problems - https://www.typescriptlang.org/docs/handbook/project-references.html[project references] & https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#faster-subsequent-builds-with-the---incremental-flag[incremental builds]
9+
10+
In a nutshell - instead of compiling the whole Kibana codebase at once, this setup enforces splitting the code base into independent projects that form a directed acyclic graph (DAG). This allows the TypeScript compiler (`tsc`) to apply several advanced optimizations:
11+
12+
- Every project emits `public` interfaces in the form of `d.ts` type declarations generated by the TypeScript compiler
13+
- These generated `d.ts` type declarations are used whenever a referenced project is imported in a depending project
14+
- This makes it possible to determine which project needs rebuilding when the source code has changed to use a more aggressive caching strategy.
15+
16+
More details are available in the https://www.typescriptlang.org/docs/handbook/project-references.html[official docs]
17+
18+
[discrete]
19+
==== Caveats
20+
This architecture imposes several limitations to which we must comply:
21+
22+
- Projects cannot have circular dependencies. Even though the Kibana platform doesn't support circular dependencies between Kibana plugins, TypeScript (and ES6 modules) does allow circular imports between files. So in theory, you may face a problem when migrating to the TS project references and you will have to resolve this circular dependency.
23+
- A project must emit its type declaration. It's not always possible to generate a type declaration if the compiler cannot infer a type. There are two basic cases:
24+
25+
1. Your plugin exports a type inferring an internal type declared in Kibana codebase. In this case, you'll have to either export an internal type or to declare an exported type explicitly.
26+
2. Your plugin exports something inferring a type from a 3rd party library that doesn't export this type. To fix the problem, you have to declare the exported type manually.
27+
28+
[discrete]
29+
==== Prerequisites
30+
Since `tsc` doesn't support circular project references, the migration order does matter. You can migrate your plugin only when all the plugin dependencies already have migrated. It creates a situation where commonly used plugins (such as `data` or `kibana_react`) have to migrate first.
31+
32+
[discrete]
33+
==== Implementation
34+
- Make sure all the plugins listed as dependencies in `kibana.json` file have migrated to TS project references.
35+
- Add `tsconfig.json` in the root folder of your plugin.
36+
[source,json]
37+
----
38+
{
39+
"extends": "../../../tsconfig.base.json",
40+
"compilerOptions": {
41+
"composite": true,
42+
"outDir": "./target/types",
43+
"emitDeclarationOnly": true,
44+
"declaration": true,
45+
"declarationMap": true
46+
},
47+
"include": [
48+
// add all the folders containg files to be compiled
49+
],
50+
"references": [
51+
{ "path": "../../core/tsconfig.json" },
52+
// add references to other TypeScript projects your plugin dependes on
53+
]
54+
}
55+
----
56+
If your plugin imports a file not listed in `include`, the build will fail with the next message `File ‘…’ is not listed within the file list of project …’. Projects must list all files or use an 'include' pattern.`
57+
58+
- Build you plugin `./node_modules/.bin/tsc -b src/plugins/my_plugin`. Fix errors if `tsc` cannot generate type declarations for your project.
59+
- Add your project reference to `references` property of `tsconfig.refs.json`
60+
- Add your plugin to `references` property and plugin folder to `exclude` property of the `tsconfig.json` it used to belong to (for example, for `src/plugins/**` it's `tsconfig.json`; for `x-pack/plugins/**` it’s `x-pack/tsconfig.json`).
61+
- List the reference to your newly created project in all the Kibana `tsconfig.json` files that could import your project: `tsconfig.json`, `test/tsconfig.json`, `x-pack/tsconfig.json`, `x-pack/test/tsconfig.json`. And in all the plugin-specific `tsconfig.refs.json` for dependent plugins.
62+
- You can measure how your changes affect `tsc` compiler performance with `node --max-old-space-size=4096 ./node_modules/.bin/tsc -p tsconfig.json --extendedDiagnostics --noEmit`. Compare with `master` branch.
63+
64+
You can use https://github.com/elastic/kibana/pull/79446 as an example.

docs/developer/index.asciidoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[[development]]
22
= Developer guide
33

4-
[partintro]
54
--
65
Contributing to {kib} can be daunting at first, but it doesn't have to be. The following sections should get you up and
76
running in no time. If you have any problems, file an issue in the https://github.com/elastic/kibana/issues[Kibana repo].

docs/developer/plugin-list.asciidoc

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ in Kibana, e.g. visualizations. It has the form of a flyout panel.
110110
|This plugin contains several helpers and services to integrate pieces of the legacy Kibana app with the new Kibana platform.
111111
112112
113+
|{kib-repo}blob/{branch}/src/plugins/kibana_overview/README.md[kibanaOverview]
114+
|An overview page highlighting Kibana apps
115+
116+
113117
|{kib-repo}blob/{branch}/src/plugins/kibana_react/README.md[kibanaReact]
114118
|Tools for building React applications in Kibana.
115119
@@ -155,6 +159,11 @@ It also provides a stateful version of it on the start contract.
155159
|WARNING: Missing README.
156160
157161
162+
|{kib-repo}blob/{branch}/src/plugins/security_oss/README.md[securityOss]
163+
|securityOss is responsible for educating users about Elastic's free security features,
164+
so they can properly protect the data within their clusters.
165+
166+
158167
|{kib-repo}blob/{branch}/src/plugins/share/README.md[share]
159168
|Replaces the legacy ui/share module for registering share context menus.
160169
@@ -269,13 +278,6 @@ which will load the visualization's editor.
269278
|The Kibana actions plugin provides a framework to create executable actions. You can:
270279
271280
272-
|{kib-repo}blob/{branch}/x-pack/plugins/alerting_builtins/README.md[alertingBuiltins]
273-
|This plugin provides alertTypes shipped with Kibana for use with the
274-
the alerts plugin. When enabled, it will register
275-
the built-in alertTypes with the alerting plugin, register associated HTTP
276-
routes, etc.
277-
278-
279281
|{kib-repo}blob/{branch}/x-pack/plugins/alerts/README.md[alerts]
280282
|The Kibana alerting plugin provides a common place to set up alerts. You can:
281283
@@ -397,7 +399,7 @@ the infrastructure monitoring use-case within Kibana.
397399
398400
399401
|{kib-repo}blob/{branch}/x-pack/plugins/ingest_manager/README.md[ingestManager]
400-
|Fleet needs to have Elasticsearch API keys enabled, and also to have TLS enabled on kibana, (if you want to run Kibana without TLS you can provide the following config flag --xpack.ingestManager.fleet.tlsCheckDisabled=false)
402+
|Fleet needs to have Elasticsearch API keys enabled, and also to have TLS enabled on kibana, (if you want to run Kibana without TLS you can provide the following config flag --xpack.fleet.agents.tlsCheckDisabled=false)
401403
402404
403405
|{kib-repo}blob/{branch}/x-pack/plugins/ingest_pipelines/README.md[ingestPipelines]
@@ -481,6 +483,13 @@ using the CURL scripts in the scripts folder.
481483
|WARNING: Missing README.
482484
483485
486+
|{kib-repo}blob/{branch}/x-pack/plugins/stack_alerts/README.md[stackAlerts]
487+
|This plugin provides alertTypes shipped with Kibana for use with the
488+
the alerts plugin. When enabled, it will register
489+
the alertTypes by the Stack in the alerting plugin, register associated HTTP
490+
routes, etc.
491+
492+
484493
|{kib-repo}blob/{branch}/x-pack/plugins/task_manager[taskManager]
485494
|WARNING: Missing README.
486495
@@ -497,7 +506,7 @@ using the CURL scripts in the scripts folder.
497506
|WARNING: Missing README.
498507
499508
500-
|{kib-repo}blob/{branch}/x-pack/plugins/triggers_actions_ui/README.md[triggers_actions_ui]
509+
|{kib-repo}blob/{branch}/x-pack/plugins/triggers_actions_ui/README.md[triggersActionsUi]
501510
|The Kibana alerts and actions UI plugin provides a user interface for managing alerts and actions.
502511
As a developer you can reuse and extend built-in alerts and actions UI functionality:
503512

0 commit comments

Comments
 (0)