Skip to content

Commit b54ecc3

Browse files
Merge branch 'master' into feature/slm_execute_retention
2 parents 3849511 + 9413939 commit b54ecc3

File tree

848 files changed

+22290
-7400
lines changed

Some content is hidden

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

848 files changed

+22290
-7400
lines changed

Jenkinsfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
1717
'oss-ciGroup4': getOssCiGroupWorker(4),
1818
'oss-ciGroup5': getOssCiGroupWorker(5),
1919
'oss-ciGroup6': getOssCiGroupWorker(6),
20+
]),
21+
'kibana-oss-agent2': withWorkers('kibana-oss-tests2', { buildOss() }, [
2022
'oss-ciGroup7': getOssCiGroupWorker(7),
2123
'oss-ciGroup8': getOssCiGroupWorker(8),
2224
'oss-ciGroup9': getOssCiGroupWorker(9),
@@ -32,6 +34,8 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
3234
'xpack-ciGroup3': getXpackCiGroupWorker(3),
3335
'xpack-ciGroup4': getXpackCiGroupWorker(4),
3436
'xpack-ciGroup5': getXpackCiGroupWorker(5),
37+
]),
38+
'kibana-xpack-agent2': withWorkers('kibana-xpack-tests2', { buildXpack() }, [
3539
'xpack-ciGroup6': getXpackCiGroupWorker(6),
3640
'xpack-ciGroup7': getXpackCiGroupWorker(7),
3741
'xpack-ciGroup8': getXpackCiGroupWorker(8),

STYLEGUIDE.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,39 @@ function addBar(foos, foo) {
141141
}
142142
```
143143
144+
### Avoid `any` whenever possible
145+
146+
Since TypeScript 3.0 and the introduction of the
147+
[`unknown` type](https://mariusschulz.com/blog/the-unknown-type-in-typescript) there are rarely any
148+
reasons to use `any` as a type. Nearly all places of former `any` usage can be replace by either a
149+
generic or `unknown` (in cases the type is really not known).
150+
151+
You should always prefer using those mechanisms over using `any`, since they are stricter typed and
152+
less likely to introduce bugs in the future due to insufficient types.
153+
154+
If you’re not having `any` in your plugin or are starting a new plugin, you should enable the
155+
[`@typescript-eslint/no-explicit-any`](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-explicit-any.md)
156+
linting rule for your plugin via the [`.eslintrc.js`](https://github.com/elastic/kibana/blob/master/.eslintrc.js) config.
157+
158+
### Avoid non-null assertions
159+
160+
You should try avoiding non-null assertions (`!.`) wherever possible. By using them you tell
161+
TypeScript, that something is not null even though by it’s type it could be. Usage of non-null
162+
assertions is most often a side-effect of you actually checked that the variable is not `null`
163+
but TypeScript doesn’t correctly carry on that information till the usage of the variable.
164+
165+
In most cases it’s possible to replace the non-null assertion by structuring your code/checks slightly different
166+
or using [user defined type guards](https://www.typescriptlang.org/docs/handbook/advanced-types.html#user-defined-type-guards)
167+
to properly tell TypeScript what type a variable has.
168+
169+
Using non-null assertion increases the risk for future bugs. In case the condition under which we assumed that the
170+
variable can’t be null has changed (potentially even due to changes in compeltely different files), the non-null
171+
assertion would now wrongly disable proper type checking for us.
172+
173+
If you’re not using non-null assertions in your plugin or are starting a new plugin, consider enabling the
174+
[`@typescript-eslint/no-non-null-assertion`](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-non-null-assertion.md)
175+
linting rule for you plugin in the [`.eslintrc.js`](https://github.com/elastic/kibana/blob/master/.eslintrc.js) config.
176+
144177
### Return/throw early from functions
145178
146179
To avoid deep nesting of if-statements, always return a function's value as early

docs/api/saved-objects/find.asciidoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ experimental[] Retrieve a paginated set of {kib} saved objects by various condit
4141
`has_reference`::
4242
(Optional, object) Filters to objects that have a relationship with the type and ID combination.
4343

44+
`filter`::
45+
(Optional, string) The filter is a KQL string with the caveat that if you filter with an attribute from your type saved object.
46+
It should look like that savedObjectType.attributes.title: "myTitle". However, If you used a direct attribute of a saved object like `updatedAt`,
47+
you will have to define your filter like that savedObjectType.updatedAt > 2018-12-22.
48+
4449
NOTE: As objects change in {kib}, the results on each page of the response also
4550
change. Use the find API for traditional paginated results, but avoid using it to export large amounts of data.
4651

docs/development/core/public/kibana-plugin-public.applicationsetup.registermountcontext.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ Register a context provider for application mounting. Will only be available to
99
<b>Signature:</b>
1010

1111
```typescript
12-
registerMountContext<T extends keyof AppMountContext>(contextName: T, provider: IContextProvider<AppMountContext, T>): void;
12+
registerMountContext<T extends keyof AppMountContext>(contextName: T, provider: IContextProvider<App['mount'], T>): void;
1313
```
1414
1515
## Parameters
1616
1717
| Parameter | Type | Description |
1818
| --- | --- | --- |
1919
| contextName | <code>T</code> | The key of [AppMountContext](./kibana-plugin-public.appmountcontext.md) this provider's return value should be attached to. |
20-
| provider | <code>IContextProvider&lt;AppMountContext, T&gt;</code> | A [IContextProvider](./kibana-plugin-public.icontextprovider.md) function |
20+
| provider | <code>IContextProvider&lt;App['mount'], T&gt;</code> | A [IContextProvider](./kibana-plugin-public.icontextprovider.md) function |
2121
2222
<b>Returns:</b>
2323

docs/development/core/public/kibana-plugin-public.applicationstart.registermountcontext.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ Register a context provider for application mounting. Will only be available to
99
<b>Signature:</b>
1010

1111
```typescript
12-
registerMountContext<T extends keyof AppMountContext>(contextName: T, provider: IContextProvider<AppMountContext, T>): void;
12+
registerMountContext<T extends keyof AppMountContext>(contextName: T, provider: IContextProvider<App['mount'], T>): void;
1313
```
1414
1515
## Parameters
1616
1717
| Parameter | Type | Description |
1818
| --- | --- | --- |
1919
| contextName | <code>T</code> | The key of [AppMountContext](./kibana-plugin-public.appmountcontext.md) this provider's return value should be attached to. |
20-
| provider | <code>IContextProvider&lt;AppMountContext, T&gt;</code> | A [IContextProvider](./kibana-plugin-public.icontextprovider.md) function |
20+
| provider | <code>IContextProvider&lt;App['mount'], T&gt;</code> | A [IContextProvider](./kibana-plugin-public.icontextprovider.md) function |
2121
2222
<b>Returns:</b>
2323

docs/development/core/public/kibana-plugin-public.appmountcontext.core.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@ core: {
1818
notifications: NotificationsStart;
1919
overlays: OverlayStart;
2020
uiSettings: UiSettingsClientContract;
21+
injectedMetadata: {
22+
getInjectedVar: (name: string, defaultValue?: any) => unknown;
23+
};
2124
};
2225
```

docs/development/core/public/kibana-plugin-public.appmountcontext.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ export interface AppMountContext
1616

1717
| Property | Type | Description |
1818
| --- | --- | --- |
19-
| [core](./kibana-plugin-public.appmountcontext.core.md) | <code>{</code><br/><code> application: Pick&lt;ApplicationStart, 'capabilities' &#124; 'navigateToApp'&gt;;</code><br/><code> chrome: ChromeStart;</code><br/><code> docLinks: DocLinksStart;</code><br/><code> http: HttpStart;</code><br/><code> i18n: I18nStart;</code><br/><code> notifications: NotificationsStart;</code><br/><code> overlays: OverlayStart;</code><br/><code> uiSettings: UiSettingsClientContract;</code><br/><code> }</code> | Core service APIs available to mounted applications. |
19+
| [core](./kibana-plugin-public.appmountcontext.core.md) | <code>{</code><br/><code> application: Pick&lt;ApplicationStart, 'capabilities' &#124; 'navigateToApp'&gt;;</code><br/><code> chrome: ChromeStart;</code><br/><code> docLinks: DocLinksStart;</code><br/><code> http: HttpStart;</code><br/><code> i18n: I18nStart;</code><br/><code> notifications: NotificationsStart;</code><br/><code> overlays: OverlayStart;</code><br/><code> uiSettings: UiSettingsClientContract;</code><br/><code> injectedMetadata: {</code><br/><code> getInjectedVar: (name: string, defaultValue?: any) =&gt; unknown;</code><br/><code> };</code><br/><code> }</code> | Core service APIs available to mounted applications. |
2020

docs/development/core/public/kibana-plugin-public.contextsetup.createcontextcontainer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ Creates a new [IContextContainer](./kibana-plugin-public.icontextcontainer.md) f
99
<b>Signature:</b>
1010

1111
```typescript
12-
createContextContainer<TContext extends {}, THandlerReturn, THandlerParmaters extends any[] = []>(): IContextContainer<TContext, THandlerReturn, THandlerParmaters>;
12+
createContextContainer<THandler extends HandlerFunction<any>>(): IContextContainer<THandler>;
1313
```
1414
<b>Returns:</b>
1515
16-
`IContextContainer<TContext, THandlerReturn, THandlerParmaters>`
16+
`IContextContainer<THandler>`
1717
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [CoreSetup](./kibana-plugin-public.coresetup.md) &gt; [injectedMetadata](./kibana-plugin-public.coresetup.injectedmetadata.md)
4+
5+
## CoreSetup.injectedMetadata property
6+
7+
> Warning: This API is now obsolete.
8+
>
9+
>
10+
11+
exposed temporarily until https://github.com/elastic/kibana/issues/41990 done use \*only\* to retrieve config values. There is no way to set injected values in the new platform. Use the legacy platform API instead.
12+
13+
<b>Signature:</b>
14+
15+
```typescript
16+
injectedMetadata: {
17+
getInjectedVar: (name: string, defaultValue?: any) => unknown;
18+
};
19+
```

docs/development/core/public/kibana-plugin-public.coresetup.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export interface CoreSetup
2020
| [context](./kibana-plugin-public.coresetup.context.md) | <code>ContextSetup</code> | [ContextSetup](./kibana-plugin-public.contextsetup.md) |
2121
| [fatalErrors](./kibana-plugin-public.coresetup.fatalerrors.md) | <code>FatalErrorsSetup</code> | [FatalErrorsSetup](./kibana-plugin-public.fatalerrorssetup.md) |
2222
| [http](./kibana-plugin-public.coresetup.http.md) | <code>HttpSetup</code> | [HttpSetup](./kibana-plugin-public.httpsetup.md) |
23+
| [injectedMetadata](./kibana-plugin-public.coresetup.injectedmetadata.md) | <code>{</code><br/><code> getInjectedVar: (name: string, defaultValue?: any) =&gt; unknown;</code><br/><code> }</code> | exposed temporarily until https://github.com/elastic/kibana/issues/41990 done use \*only\* to retrieve config values. There is no way to set injected values in the new platform. Use the legacy platform API instead. |
2324
| [notifications](./kibana-plugin-public.coresetup.notifications.md) | <code>NotificationsSetup</code> | [NotificationsSetup](./kibana-plugin-public.notificationssetup.md) |
2425
| [uiSettings](./kibana-plugin-public.coresetup.uisettings.md) | <code>UiSettingsClientContract</code> | [UiSettingsClient](./kibana-plugin-public.uisettingsclient.md) |
2526

0 commit comments

Comments
 (0)