Skip to content

Commit ec84c3f

Browse files
Merge branch 'master' into fix/72875
2 parents a08a431 + 9a27beb commit ec84c3f

File tree

462 files changed

+4048
-27268
lines changed

Some content is hidden

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

462 files changed

+4048
-27268
lines changed

docs/developer/contributing/development-github.asciidoc

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[development-github]]
2-
== How we use git and github
2+
== How we use Git and GitHub
33

44
[discrete]
55
=== Forking
@@ -12,17 +12,21 @@ repo, which we'll refer to in later code snippets.
1212
[discrete]
1313
=== Branching
1414

15-
* All work on the next major release goes into master.
16-
* Past major release branches are named `{majorVersion}.x`. They contain
17-
work that will go into the next minor release. For example, if the next
18-
minor release is `5.2.0`, work for it should go into the `5.x` branch.
19-
* Past minor release branches are named `{majorVersion}.{minorVersion}`.
20-
They contain work that will go into the next patch release. For example,
21-
if the next patch release is `5.3.1`, work for it should go into the
22-
`5.3` branch.
23-
* All work is done on feature branches and merged into one of these
24-
branches.
25-
* Where appropriate, we'll backport changes into older release branches.
15+
At Elastic, all products in the stack, including Kibana, are released at the same time with the same version number. Most of these projects have the following branching strategy:
16+
17+
* `master` is the next major version.
18+
* `<major>.x` is the next minor version.
19+
* `<major>.<minor>` is the next release of a minor version, including patch releases.
20+
21+
As an example, let's assume that the `7.x` branch is currently a not-yet-released `7.6.0`. Once `7.6.0` has reached feature freeze, it will be branched to `7.6` and `7.x` will be updated to reflect `7.7.0`. The release of `7.6.0` and subsequent patch releases will be cut from the `7.6` branch. At any time, you can verify the current version of a branch by inspecting the `version` attribute in the `package.json` file within the Kibana source.
22+
23+
Pull requests are made into the `master` branch and then backported when it is safe and appropriate.
24+
25+
* Breaking changes do not get backported and only go into `master`.
26+
* All non-breaking changes can be backported to the `<major>.x` branch.
27+
* Features should not be backported to a `<major>.<minor>` branch.
28+
* Bugs can be backported to a `<major>.<minor>` branch if the changes are safe and appropriate. Safety is a judgment call you make based on factors like the bug's severity, test coverage, confidence in the changes, etc. Your reasoning should be included in the pull request description.
29+
* Documentation changes can be backported to any branch at any time.
2630

2731
[discrete]
2832
=== Commits and Merging
@@ -109,4 +113,4 @@ Assuming you've successfully rebased and you're happy with the code, you should
109113
[discrete]
110114
=== Creating a pull request
111115

112-
See <<development-pull-request>> for the next steps on getting your code changes merged into {kib}.
116+
See <<development-pull-request>> for the next steps on getting your code changes merged into {kib}.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [StatusServiceSetup](./kibana-plugin-core-server.statusservicesetup.md) &gt; [dependencies$](./kibana-plugin-core-server.statusservicesetup.dependencies_.md)
4+
5+
## StatusServiceSetup.dependencies$ property
6+
7+
Current status for all plugins this plugin depends on. Each key of the `Record` is a plugin id.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
dependencies$: Observable<Record<string, ServiceStatus>>;
13+
```
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [StatusServiceSetup](./kibana-plugin-core-server.statusservicesetup.md) &gt; [derivedStatus$](./kibana-plugin-core-server.statusservicesetup.derivedstatus_.md)
4+
5+
## StatusServiceSetup.derivedStatus$ property
6+
7+
The status of this plugin as derived from its dependencies.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
derivedStatus$: Observable<ServiceStatus>;
13+
```
14+
15+
## Remarks
16+
17+
By default, plugins inherit this derived status from their dependencies. Calling overrides this default status.
18+
19+
This may emit multliple times for a single status change event as propagates through the dependency tree
20+

docs/development/core/server/kibana-plugin-core-server.statusservicesetup.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,73 @@ API for accessing status of Core and this plugin's dependencies as well as for c
1212
export interface StatusServiceSetup
1313
```
1414

15+
## Remarks
16+
17+
By default, a plugin inherits it's current status from the most severe status level of any Core services and any plugins that it depends on. This default status is available on the API.
18+
19+
Plugins may customize their status calculation by calling the API with an Observable. Within this Observable, a plugin may choose to only depend on the status of some of its dependencies, to ignore severe status levels of particular Core services they are not concerned with, or to make its status dependent on other external services.
20+
21+
## Example 1
22+
23+
Customize a plugin's status to only depend on the status of SavedObjects:
24+
25+
```ts
26+
core.status.set(
27+
core.status.core$.pipe(
28+
. map((coreStatus) => {
29+
return coreStatus.savedObjects;
30+
}) ;
31+
);
32+
);
33+
34+
```
35+
36+
## Example 2
37+
38+
Customize a plugin's status to include an external service:
39+
40+
```ts
41+
const externalStatus$ = interval(1000).pipe(
42+
switchMap(async () => {
43+
const resp = await fetch(`https://myexternaldep.com/_healthz`);
44+
const body = await resp.json();
45+
if (body.ok) {
46+
return of({ level: ServiceStatusLevels.available, summary: 'External Service is up'});
47+
} else {
48+
return of({ level: ServiceStatusLevels.available, summary: 'External Service is unavailable'});
49+
}
50+
}),
51+
catchError((error) => {
52+
of({ level: ServiceStatusLevels.unavailable, summary: `External Service is down`, meta: { error }})
53+
})
54+
);
55+
56+
core.status.set(
57+
combineLatest([core.status.derivedStatus$, externalStatus$]).pipe(
58+
map(([derivedStatus, externalStatus]) => {
59+
if (externalStatus.level > derivedStatus) {
60+
return externalStatus;
61+
} else {
62+
return derivedStatus;
63+
}
64+
})
65+
)
66+
);
67+
68+
```
69+
1570
## Properties
1671

1772
| Property | Type | Description |
1873
| --- | --- | --- |
1974
| [core$](./kibana-plugin-core-server.statusservicesetup.core_.md) | <code>Observable&lt;CoreStatus&gt;</code> | Current status for all Core services. |
75+
| [dependencies$](./kibana-plugin-core-server.statusservicesetup.dependencies_.md) | <code>Observable&lt;Record&lt;string, ServiceStatus&gt;&gt;</code> | Current status for all plugins this plugin depends on. Each key of the <code>Record</code> is a plugin id. |
76+
| [derivedStatus$](./kibana-plugin-core-server.statusservicesetup.derivedstatus_.md) | <code>Observable&lt;ServiceStatus&gt;</code> | The status of this plugin as derived from its dependencies. |
2077
| [overall$](./kibana-plugin-core-server.statusservicesetup.overall_.md) | <code>Observable&lt;ServiceStatus&gt;</code> | Overall system status for all of Kibana. |
2178

79+
## Methods
80+
81+
| Method | Description |
82+
| --- | --- |
83+
| [set(status$)](./kibana-plugin-core-server.statusservicesetup.set.md) | Allows a plugin to specify a custom status dependent on its own criteria. Completely overrides the default inherited status. |
84+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [StatusServiceSetup](./kibana-plugin-core-server.statusservicesetup.md) &gt; [set](./kibana-plugin-core-server.statusservicesetup.set.md)
4+
5+
## StatusServiceSetup.set() method
6+
7+
Allows a plugin to specify a custom status dependent on its own criteria. Completely overrides the default inherited status.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
set(status$: Observable<ServiceStatus>): void;
13+
```
14+
15+
## Parameters
16+
17+
| Parameter | Type | Description |
18+
| --- | --- | --- |
19+
| status$ | <code>Observable&lt;ServiceStatus&gt;</code> | |
20+
21+
<b>Returns:</b>
22+
23+
`void`
24+
25+
## Remarks
26+
27+
See the [StatusServiceSetup.derivedStatus$](./kibana-plugin-core-server.statusservicesetup.derivedstatus_.md) API for leveraging the default status calculation that is provided by Core.
28+

docs/development/plugins/data/public/kibana-plugin-plugins-data-public.querystringinput.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
<b>Signature:</b>
88

99
```typescript
10-
QueryStringInput: React.FC<Pick<Props, "query" | "prepend" | "placeholder" | "onChange" | "onBlur" | "onSubmit" | "indexPatterns" | "dataTestSubj" | "screenTitle" | "disableAutoFocus" | "persistedLog" | "bubbleSubmitEvent" | "languageSwitcherPopoverAnchorPosition" | "onChangeQueryInputFocus">>
10+
QueryStringInput: React.FC<Pick<Props, "query" | "prepend" | "size" | "placeholder" | "onChange" | "onBlur" | "onSubmit" | "indexPatterns" | "dataTestSubj" | "screenTitle" | "disableAutoFocus" | "persistedLog" | "bubbleSubmitEvent" | "languageSwitcherPopoverAnchorPosition" | "onChangeQueryInputFocus">>
1111
```

rfcs/text/0010_service_status.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ interface StatusSetup {
137137
* Current status for all dependencies of the current plugin.
138138
* Each key of the `Record` is a plugin id.
139139
*/
140-
plugins$: Observable<Record<string, ServiceStatus>>;
140+
dependencies$: Observable<Record<string, ServiceStatus>>;
141141

142142
/**
143143
* The status of this plugin as derived from its dependencies.

src/core/public/chrome/recently_accessed/persisted_log.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ const createMockStorage = () => ({
2828
length: 0,
2929
});
3030

31-
jest.mock('ui/chrome', () => {
32-
return {
33-
getBasePath: () => `/some/base/path`,
34-
};
35-
});
36-
3731
const historyName = 'testHistory';
3832
const historyLimit = 10;
3933
const payload = [

src/core/server/legacy/legacy_service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,9 @@ export class LegacyService implements CoreService {
323323
status: {
324324
core$: setupDeps.core.status.core$,
325325
overall$: setupDeps.core.status.overall$,
326+
set: setupDeps.core.status.plugins.set.bind(null, 'legacy'),
327+
dependencies$: setupDeps.core.status.plugins.getDependenciesStatus$('legacy'),
328+
derivedStatus$: setupDeps.core.status.plugins.getDerivedStatus$('legacy'),
326329
},
327330
uiSettings: {
328331
register: setupDeps.core.uiSettings.register,

src/core/server/plugins/plugin_context.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ export function createPluginSetupContext<TPlugin, TPluginDependencies>(
185185
status: {
186186
core$: deps.status.core$,
187187
overall$: deps.status.overall$,
188+
set: deps.status.plugins.set.bind(null, plugin.name),
189+
dependencies$: deps.status.plugins.getDependenciesStatus$(plugin.name),
190+
derivedStatus$: deps.status.plugins.getDerivedStatus$(plugin.name),
188191
},
189192
uiSettings: {
190193
register: deps.uiSettings.register,

0 commit comments

Comments
 (0)