Skip to content

Commit 47c0814

Browse files
Merge branch '7.x' into backport/7.x/pr-73781
2 parents acac0f0 + 4502447 commit 47c0814

File tree

1,190 files changed

+17492
-8936
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,190 files changed

+17492
-8936
lines changed

.ci/pipeline-library/src/test/slackNotifications.groovy

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class SlackNotificationsTest extends KibanaBasePipelineTest {
99
super.setUp()
1010

1111
helper.registerAllowedMethod('slackSend', [Map.class], null)
12+
prop('buildState', loadScript("vars/buildState.groovy"))
1213
slackNotifications = loadScript('vars/slackNotifications.groovy')
1314
}
1415

@@ -25,13 +26,49 @@ class SlackNotificationsTest extends KibanaBasePipelineTest {
2526
}
2627

2728
@Test
28-
void 'sendFailedBuild() should call slackSend() with message'() {
29+
void 'sendFailedBuild() should call slackSend() with an in-progress message'() {
2930
mockFailureBuild()
3031

3132
slackNotifications.sendFailedBuild()
3233

3334
def args = fnMock('slackSend').args[0]
3435

36+
def expected = [
37+
channel: '#kibana-operations-alerts',
38+
username: 'Kibana Operations',
39+
iconEmoji: ':jenkins:',
40+
color: 'danger',
41+
message: ':hourglass_flowing_sand: elastic / kibana # master #1',
42+
]
43+
44+
expected.each {
45+
assertEquals(it.value.toString(), args[it.key].toString())
46+
}
47+
48+
assertEquals(
49+
":hourglass_flowing_sand: *<http://jenkins.localhost:8080/job/elastic+kibana+master/1/|elastic / kibana # master #1>*",
50+
args.blocks[0].text.text.toString()
51+
)
52+
53+
assertEquals(
54+
"*Failed Steps*\n• <http://jenkins.localhost:8080|Execute test task>",
55+
args.blocks[1].text.text.toString()
56+
)
57+
58+
assertEquals(
59+
"*Test Failures*\n• <https://localhost/|x-pack/test/functional/apps/fake/test·ts.Fake test &lt;Component&gt; should &amp; pass &amp;>",
60+
args.blocks[2].text.text.toString()
61+
)
62+
}
63+
64+
@Test
65+
void 'sendFailedBuild() should call slackSend() with message'() {
66+
mockFailureBuild()
67+
68+
slackNotifications.sendFailedBuild(isFinal: true)
69+
70+
def args = fnMock('slackSend').args[0]
71+
3572
def expected = [
3673
channel: '#kibana-operations-alerts',
3774
username: 'Kibana Operations',
@@ -65,7 +102,7 @@ class SlackNotificationsTest extends KibanaBasePipelineTest {
65102
mockFailureBuild()
66103
def counter = 0
67104
helper.registerAllowedMethod('slackSend', [Map.class], { ++counter > 1 })
68-
slackNotifications.sendFailedBuild()
105+
slackNotifications.sendFailedBuild(isFinal: true)
69106

70107
def args = fnMocks('slackSend')[1].args[0]
71108

@@ -88,6 +125,29 @@ class SlackNotificationsTest extends KibanaBasePipelineTest {
88125
)
89126
}
90127

128+
@Test
129+
void 'sendFailedBuild() should call slackSend() with a channel id and timestamp on second call'() {
130+
mockFailureBuild()
131+
helper.registerAllowedMethod('slackSend', [Map.class], { [ channelId: 'CHANNEL_ID', ts: 'TIMESTAMP' ] })
132+
slackNotifications.sendFailedBuild(isFinal: false)
133+
slackNotifications.sendFailedBuild(isFinal: true)
134+
135+
def args = fnMocks('slackSend')[1].args[0]
136+
137+
def expected = [
138+
channel: 'CHANNEL_ID',
139+
timestamp: 'TIMESTAMP',
140+
username: 'Kibana Operations',
141+
iconEmoji: ':jenkins:',
142+
color: 'danger',
143+
message: ':broken_heart: elastic / kibana # master #1',
144+
]
145+
146+
expected.each {
147+
assertEquals(it.value.toString(), args[it.key].toString())
148+
}
149+
}
150+
91151
@Test
92152
void 'getTestFailures() should truncate list of failures to 10'() {
93153
prop('testUtils', [

Jenkinsfile

Lines changed: 48 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,59 +4,60 @@ library 'kibana-pipeline-library'
44
kibanaLibrary.load()
55

66
kibanaPipeline(timeoutMinutes: 155, checkPrChanges: true, setCommitStatus: true) {
7-
githubPr.withDefaultPrComments {
8-
ciStats.trackBuild {
9-
catchError {
10-
retryable.enable()
11-
parallel([
12-
'kibana-intake-agent': workers.intake('kibana-intake', './test/scripts/jenkins_unit.sh'),
13-
'x-pack-intake-agent': workers.intake('x-pack-intake', './test/scripts/jenkins_xpack.sh'),
14-
'kibana-oss-agent': workers.functional('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
15-
'oss-firefoxSmoke': kibanaPipeline.functionalTestProcess('kibana-firefoxSmoke', './test/scripts/jenkins_firefox_smoke.sh'),
16-
'oss-ciGroup1': kibanaPipeline.ossCiGroupProcess(1),
17-
'oss-ciGroup2': kibanaPipeline.ossCiGroupProcess(2),
18-
'oss-ciGroup3': kibanaPipeline.ossCiGroupProcess(3),
19-
'oss-ciGroup4': kibanaPipeline.ossCiGroupProcess(4),
20-
'oss-ciGroup5': kibanaPipeline.ossCiGroupProcess(5),
21-
'oss-ciGroup6': kibanaPipeline.ossCiGroupProcess(6),
22-
'oss-ciGroup7': kibanaPipeline.ossCiGroupProcess(7),
23-
'oss-ciGroup8': kibanaPipeline.ossCiGroupProcess(8),
24-
'oss-ciGroup9': kibanaPipeline.ossCiGroupProcess(9),
25-
'oss-ciGroup10': kibanaPipeline.ossCiGroupProcess(10),
26-
'oss-ciGroup11': kibanaPipeline.ossCiGroupProcess(11),
27-
'oss-ciGroup12': kibanaPipeline.ossCiGroupProcess(12),
28-
'oss-accessibility': kibanaPipeline.functionalTestProcess('kibana-accessibility', './test/scripts/jenkins_accessibility.sh'),
29-
// 'oss-visualRegression': kibanaPipeline.functionalTestProcess('visualRegression', './test/scripts/jenkins_visual_regression.sh'),
30-
]),
31-
'kibana-xpack-agent': workers.functional('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
32-
'xpack-firefoxSmoke': kibanaPipeline.functionalTestProcess('xpack-firefoxSmoke', './test/scripts/jenkins_xpack_firefox_smoke.sh'),
33-
'xpack-ciGroup1': kibanaPipeline.xpackCiGroupProcess(1),
34-
'xpack-ciGroup2': kibanaPipeline.xpackCiGroupProcess(2),
35-
'xpack-ciGroup3': kibanaPipeline.xpackCiGroupProcess(3),
36-
'xpack-ciGroup4': kibanaPipeline.xpackCiGroupProcess(4),
37-
'xpack-ciGroup5': kibanaPipeline.xpackCiGroupProcess(5),
38-
'xpack-ciGroup6': kibanaPipeline.xpackCiGroupProcess(6),
39-
'xpack-ciGroup7': kibanaPipeline.xpackCiGroupProcess(7),
40-
'xpack-ciGroup8': kibanaPipeline.xpackCiGroupProcess(8),
41-
'xpack-ciGroup9': kibanaPipeline.xpackCiGroupProcess(9),
42-
'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10),
43-
'xpack-accessibility': kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh'),
44-
'xpack-savedObjectsFieldMetrics': kibanaPipeline.functionalTestProcess('xpack-savedObjectsFieldMetrics', './test/scripts/jenkins_xpack_saved_objects_field_metrics.sh'),
45-
'xpack-securitySolutionCypress': { processNumber ->
46-
whenChanged(['x-pack/plugins/security_solution/', 'x-pack/test/security_solution_cypress/', 'x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/', 'x-pack/plugins/triggers_actions_ui/public/application/context/actions_connectors_context.tsx']) {
47-
kibanaPipeline.functionalTestProcess('xpack-securitySolutionCypress', './test/scripts/jenkins_security_solution_cypress.sh')(processNumber)
48-
}
49-
},
7+
slackNotifications.onFailure(disabled: !params.NOTIFY_ON_FAILURE) {
8+
githubPr.withDefaultPrComments {
9+
ciStats.trackBuild {
10+
catchError {
11+
retryable.enable()
12+
parallel([
13+
'kibana-intake-agent': workers.intake('kibana-intake', './test/scripts/jenkins_unit.sh'),
14+
'x-pack-intake-agent': workers.intake('x-pack-intake', './test/scripts/jenkins_xpack.sh'),
15+
'kibana-oss-agent': workers.functional('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
16+
'oss-firefoxSmoke': kibanaPipeline.functionalTestProcess('kibana-firefoxSmoke', './test/scripts/jenkins_firefox_smoke.sh'),
17+
'oss-ciGroup1': kibanaPipeline.ossCiGroupProcess(1),
18+
'oss-ciGroup2': kibanaPipeline.ossCiGroupProcess(2),
19+
'oss-ciGroup3': kibanaPipeline.ossCiGroupProcess(3),
20+
'oss-ciGroup4': kibanaPipeline.ossCiGroupProcess(4),
21+
'oss-ciGroup5': kibanaPipeline.ossCiGroupProcess(5),
22+
'oss-ciGroup6': kibanaPipeline.ossCiGroupProcess(6),
23+
'oss-ciGroup7': kibanaPipeline.ossCiGroupProcess(7),
24+
'oss-ciGroup8': kibanaPipeline.ossCiGroupProcess(8),
25+
'oss-ciGroup9': kibanaPipeline.ossCiGroupProcess(9),
26+
'oss-ciGroup10': kibanaPipeline.ossCiGroupProcess(10),
27+
'oss-ciGroup11': kibanaPipeline.ossCiGroupProcess(11),
28+
'oss-ciGroup12': kibanaPipeline.ossCiGroupProcess(12),
29+
'oss-accessibility': kibanaPipeline.functionalTestProcess('kibana-accessibility', './test/scripts/jenkins_accessibility.sh'),
30+
// 'oss-visualRegression': kibanaPipeline.functionalTestProcess('visualRegression', './test/scripts/jenkins_visual_regression.sh'),
31+
]),
32+
'kibana-xpack-agent': workers.functional('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
33+
'xpack-firefoxSmoke': kibanaPipeline.functionalTestProcess('xpack-firefoxSmoke', './test/scripts/jenkins_xpack_firefox_smoke.sh'),
34+
'xpack-ciGroup1': kibanaPipeline.xpackCiGroupProcess(1),
35+
'xpack-ciGroup2': kibanaPipeline.xpackCiGroupProcess(2),
36+
'xpack-ciGroup3': kibanaPipeline.xpackCiGroupProcess(3),
37+
'xpack-ciGroup4': kibanaPipeline.xpackCiGroupProcess(4),
38+
'xpack-ciGroup5': kibanaPipeline.xpackCiGroupProcess(5),
39+
'xpack-ciGroup6': kibanaPipeline.xpackCiGroupProcess(6),
40+
'xpack-ciGroup7': kibanaPipeline.xpackCiGroupProcess(7),
41+
'xpack-ciGroup8': kibanaPipeline.xpackCiGroupProcess(8),
42+
'xpack-ciGroup9': kibanaPipeline.xpackCiGroupProcess(9),
43+
'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10),
44+
'xpack-accessibility': kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh'),
45+
'xpack-savedObjectsFieldMetrics': kibanaPipeline.functionalTestProcess('xpack-savedObjectsFieldMetrics', './test/scripts/jenkins_xpack_saved_objects_field_metrics.sh'),
46+
'xpack-securitySolutionCypress': { processNumber ->
47+
whenChanged(['x-pack/plugins/security_solution/', 'x-pack/test/security_solution_cypress/', 'x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/', 'x-pack/plugins/triggers_actions_ui/public/application/context/actions_connectors_context.tsx']) {
48+
kibanaPipeline.functionalTestProcess('xpack-securitySolutionCypress', './test/scripts/jenkins_security_solution_cypress.sh')(processNumber)
49+
}
50+
},
5051

51-
// 'xpack-visualRegression': kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh'),
52-
]),
53-
])
52+
// 'xpack-visualRegression': kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh'),
53+
]),
54+
])
55+
}
5456
}
5557
}
5658
}
5759

5860
if (params.NOTIFY_ON_FAILURE) {
59-
slackNotifications.onFailure()
6061
kibanaPipeline.sendMail()
6162
}
6263
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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; [KibanaRequestEvents](./kibana-plugin-core-server.kibanarequestevents.md) &gt; [completed$](./kibana-plugin-core-server.kibanarequestevents.completed_.md)
4+
5+
## KibanaRequestEvents.completed$ property
6+
7+
Observable that emits once if and when the request has been completely handled.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
completed$: Observable<void>;
13+
```
14+
15+
## Remarks
16+
17+
The request may be considered completed if: - A response has been sent to the client; or - The request was aborted.
18+

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ export interface KibanaRequestEvents
1717
| Property | Type | Description |
1818
| --- | --- | --- |
1919
| [aborted$](./kibana-plugin-core-server.kibanarequestevents.aborted_.md) | <code>Observable&lt;void&gt;</code> | Observable that emits once if and when the request has been aborted. |
20+
| [completed$](./kibana-plugin-core-server.kibanarequestevents.completed_.md) | <code>Observable&lt;void&gt;</code> | Observable that emits once if and when the request has been completely handled. |
2021

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export declare class SearchInterceptor
3535

3636
| Method | Modifiers | Description |
3737
| --- | --- | --- |
38-
| [runSearch(request, combinedSignal)](./kibana-plugin-plugins-data-public.searchinterceptor.runsearch.md) | | |
38+
| [runSearch(request, signal)](./kibana-plugin-plugins-data-public.searchinterceptor.runsearch.md) | | |
3939
| [search(request, options)](./kibana-plugin-plugins-data-public.searchinterceptor.search.md) | | Searches using the given <code>search</code> method. Overrides the <code>AbortSignal</code> with one that will abort either when <code>cancelPending</code> is called, when the request times out, or when the original <code>AbortSignal</code> is aborted. Updates the <code>pendingCount</code> when the request is started/finalized. |
4040
| [setupTimers(options)](./kibana-plugin-plugins-data-public.searchinterceptor.setuptimers.md) | | |
4141

docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchinterceptor.runsearch.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
<b>Signature:</b>
88

99
```typescript
10-
protected runSearch(request: IEsSearchRequest, combinedSignal: AbortSignal): Observable<IEsSearchResponse>;
10+
protected runSearch(request: IEsSearchRequest, signal: AbortSignal): Observable<IEsSearchResponse>;
1111
```
1212

1313
## Parameters
1414

1515
| Parameter | Type | Description |
1616
| --- | --- | --- |
1717
| request | <code>IEsSearchRequest</code> | |
18-
| combinedSignal | <code>AbortSignal</code> | |
18+
| signal | <code>AbortSignal</code> | |
1919

2020
<b>Returns:</b>
2121

docs/development/plugins/data/server/kibana-plugin-plugins-data-server.isearchsetup.usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ Used internally for telemetry
99
<b>Signature:</b>
1010

1111
```typescript
12-
usage: SearchUsage;
12+
usage?: SearchUsage;
1313
```

docs/development/plugins/data/server/kibana-plugin-plugins-data-server.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
| [parseInterval(interval)](./kibana-plugin-plugins-data-server.parseinterval.md) | |
2828
| [plugin(initializerContext)](./kibana-plugin-plugins-data-server.plugin.md) | Static code to be shared externally |
2929
| [shouldReadFieldFromDocValues(aggregatable, esType)](./kibana-plugin-plugins-data-server.shouldreadfieldfromdocvalues.md) | |
30+
| [usageProvider(core)](./kibana-plugin-plugins-data-server.usageprovider.md) | |
3031

3132
## Interfaces
3233

@@ -49,6 +50,7 @@
4950
| [PluginStart](./kibana-plugin-plugins-data-server.pluginstart.md) | |
5051
| [Query](./kibana-plugin-plugins-data-server.query.md) | |
5152
| [RefreshInterval](./kibana-plugin-plugins-data-server.refreshinterval.md) | |
53+
| [SearchUsage](./kibana-plugin-plugins-data-server.searchusage.md) | |
5254
| [TimeRange](./kibana-plugin-plugins-data-server.timerange.md) | |
5355

5456
## Variables
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-plugins-data-server](./kibana-plugin-plugins-data-server.md) &gt; [SearchUsage](./kibana-plugin-plugins-data-server.searchusage.md)
4+
5+
## SearchUsage interface
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
export interface SearchUsage
11+
```
12+
13+
## Methods
14+
15+
| Method | Description |
16+
| --- | --- |
17+
| [trackError()](./kibana-plugin-plugins-data-server.searchusage.trackerror.md) | |
18+
| [trackSuccess(duration)](./kibana-plugin-plugins-data-server.searchusage.tracksuccess.md) | |
19+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) &gt; [SearchUsage](./kibana-plugin-plugins-data-server.searchusage.md) &gt; [trackError](./kibana-plugin-plugins-data-server.searchusage.trackerror.md)
4+
5+
## SearchUsage.trackError() method
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
trackError(): Promise<void>;
11+
```
12+
<b>Returns:</b>
13+
14+
`Promise<void>`
15+

0 commit comments

Comments
 (0)