Skip to content

Commit 46ac4bf

Browse files
Merge branch '7.x' into backport/7.x/pr-89816
2 parents 85e559d + ee68eff commit 46ac4bf

File tree

1,894 files changed

+42285
-13466
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,894 files changed

+42285
-13466
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.12",
67
"7.11",
78
"7.10",
89
"7.9",
@@ -29,7 +30,7 @@
2930
"targetPRLabels": ["backport"],
3031
"branchLabelMapping": {
3132
"^v8.0.0$": "master",
32-
"^v7.12.0$": "7.x",
33+
"^v7.13.0$": "7.x",
3334
"^v(\\d+).(\\d+).\\d+$": "$1.$2"
3435
}
3536
}

.ci/.storybook/main.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
7+
*/
8+
9+
const config = require('@kbn/storybook').defaultConfig;
10+
const aliases = require('../../src/dev/storybook/aliases.ts').storybookAliases;
11+
12+
config.refs = {};
13+
14+
for (const alias of Object.keys(aliases).filter((a) => a !== 'ci_composite')) {
15+
// snake_case -> Title Case
16+
const title = alias
17+
.replace(/_/g, ' ')
18+
.split(' ')
19+
.map((n) => n[0].toUpperCase() + n.slice(1))
20+
.join(' ');
21+
22+
config.refs[alias] = {
23+
title: title,
24+
url: `${process.env.STORYBOOK_BASE_URL}/${alias}`,
25+
};
26+
}
27+
28+
module.exports = config;

.ci/Jenkinsfile_flaky

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

6-
def CI_GROUP_PARAM = params.CI_GROUP
6+
def TASK_PARAM = params.TASK ?: params.CI_GROUP
77

88
// Looks like 'oss:ciGroup:1', 'oss:firefoxSmoke'
9-
def JOB_PARTS = CI_GROUP_PARAM.split(':')
9+
def JOB_PARTS = TASK_PARAM.split(':')
1010
def IS_XPACK = JOB_PARTS[0] == 'xpack'
11-
def JOB = JOB_PARTS[1]
11+
def JOB = JOB_PARTS.size() > 1 ? JOB_PARTS[1] : JOB_PARTS[0]
1212
def CI_GROUP = JOB_PARTS.size() > 2 ? JOB_PARTS[2] : ''
1313
def EXECUTIONS = params.NUMBER_EXECUTIONS.toInteger()
1414
def AGENT_COUNT = getAgentCount(EXECUTIONS)
15-
16-
def worker = getWorkerFromParams(IS_XPACK, JOB, CI_GROUP)
17-
18-
def workerFailures = []
15+
def NEED_BUILD = JOB != 'jestIntegration' && JOB != 'apiIntegration'
1916

2017
currentBuild.displayName += trunc(" ${params.GITHUB_OWNER}:${params.branch_specifier}", 24)
2118
currentBuild.description = "${params.CI_GROUP}<br />Agents: ${AGENT_COUNT}<br />Executions: ${params.NUMBER_EXECUTIONS}"
2219

2320
kibanaPipeline(timeoutMinutes: 180) {
2421
def agents = [:]
22+
def workerFailures = []
23+
24+
def worker = getWorkerFromParams(IS_XPACK, JOB, CI_GROUP)
25+
2526
for(def agentNumber = 1; agentNumber <= AGENT_COUNT; agentNumber++) {
26-
def agentNumberInside = agentNumber
2727
def agentExecutions = floor(EXECUTIONS/AGENT_COUNT) + (agentNumber <= EXECUTIONS%AGENT_COUNT ? 1 : 0)
28+
2829
agents["agent-${agentNumber}"] = {
29-
catchErrors {
30-
print "Agent ${agentNumberInside} - ${agentExecutions} executions"
31-
32-
withEnv([
33-
'IGNORE_SHIP_CI_STATS_ERROR=true',
34-
]) {
35-
workers.functional('flaky-test-runner', {
36-
if (!IS_XPACK) {
37-
kibanaPipeline.buildOss()
38-
if (CI_GROUP == '1') {
39-
runbld("./test/scripts/jenkins_build_kbn_sample_panel_action.sh", "Build kbn tp sample panel action for ciGroup1")
40-
}
41-
} else {
42-
kibanaPipeline.buildXpack()
43-
}
44-
}, getWorkerMap(agentNumberInside, agentExecutions, worker, workerFailures))()
45-
}
46-
}
30+
agentProcess(
31+
agentNumber: agentNumber,
32+
agentExecutions: agentExecutions,
33+
worker: worker,
34+
workerFailures: workerFailures,
35+
needBuild: NEED_BUILD,
36+
isXpack: IS_XPACK,
37+
ciGroup: CI_GROUP
38+
)
4739
}
4840
}
4941

@@ -59,14 +51,70 @@ kibanaPipeline(timeoutMinutes: 180) {
5951
}
6052
}
6153

54+
def agentProcess(Map params = [:]) {
55+
def config = [
56+
agentNumber: 1,
57+
agentExecutions: 0,
58+
worker: {},
59+
workerFailures: [],
60+
needBuild: false,
61+
isXpack: false,
62+
ciGroup: null,
63+
] + params
64+
65+
catchErrors {
66+
print "Agent ${config.agentNumber} - ${config.agentExecutions} executions"
67+
68+
withEnv([
69+
'IGNORE_SHIP_CI_STATS_ERROR=true',
70+
]) {
71+
kibanaPipeline.withTasks([
72+
parallel: 20,
73+
]) {
74+
task {
75+
if (config.needBuild) {
76+
if (!config.isXpack) {
77+
kibanaPipeline.buildOss()
78+
} else {
79+
kibanaPipeline.buildXpack()
80+
}
81+
}
82+
83+
for(def i = 0; i < config.agentExecutions; i++) {
84+
def taskNumber = i
85+
task({
86+
withEnv([
87+
"REMOVE_KIBANA_INSTALL_DIR=1",
88+
]) {
89+
catchErrors {
90+
try {
91+
config.worker()
92+
} catch (ex) {
93+
config.workerFailures << "agent-${config.agentNumber}-${taskNumber}"
94+
throw ex
95+
}
96+
}
97+
}
98+
})
99+
}
100+
}
101+
}
102+
}
103+
}
104+
}
105+
62106
def getWorkerFromParams(isXpack, job, ciGroup) {
63107
if (!isXpack) {
64108
if (job == 'accessibility') {
65109
return kibanaPipeline.functionalTestProcess('kibana-accessibility', './test/scripts/jenkins_accessibility.sh')
66110
} else if (job == 'firefoxSmoke') {
67111
return kibanaPipeline.functionalTestProcess('firefoxSmoke', './test/scripts/jenkins_firefox_smoke.sh')
68-
} else if(job == 'visualRegression') {
112+
} else if (job == 'visualRegression') {
69113
return kibanaPipeline.functionalTestProcess('visualRegression', './test/scripts/jenkins_visual_regression.sh')
114+
} else if (job == 'jestIntegration') {
115+
return kibanaPipeline.scriptTaskDocker('Jest Integration Tests', 'test/scripts/test/jest_integration.sh')
116+
} else if (job == 'apiIntegration') {
117+
return kibanaPipeline.scriptTask('API Integration Tests', 'test/scripts/test/api_integration.sh')
70118
} else {
71119
return kibanaPipeline.ossCiGroupProcess(ciGroup)
72120
}
@@ -76,45 +124,16 @@ def getWorkerFromParams(isXpack, job, ciGroup) {
76124
return kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh')
77125
} else if (job == 'firefoxSmoke') {
78126
return kibanaPipeline.functionalTestProcess('xpack-firefoxSmoke', './test/scripts/jenkins_xpack_firefox_smoke.sh')
79-
} else if(job == 'visualRegression') {
127+
} else if (job == 'visualRegression') {
80128
return kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh')
81129
} else {
82130
return kibanaPipeline.xpackCiGroupProcess(ciGroup)
83131
}
84132
}
85133

86-
def getWorkerMap(agentNumber, numberOfExecutions, worker, workerFailures, maxWorkerProcesses = 12) {
87-
def workerMap = [:]
88-
def numberOfWorkers = Math.min(numberOfExecutions, maxWorkerProcesses)
89-
90-
for(def i = 1; i <= numberOfWorkers; i++) {
91-
def workerExecutions = floor(numberOfExecutions/numberOfWorkers + (i <= numberOfExecutions%numberOfWorkers ? 1 : 0))
92-
93-
workerMap["agent-${agentNumber}-worker-${i}"] = { workerNumber ->
94-
for(def j = 0; j < workerExecutions; j++) {
95-
print "Execute agent-${agentNumber} worker-${workerNumber}: ${j}"
96-
withEnv([
97-
"REMOVE_KIBANA_INSTALL_DIR=1",
98-
]) {
99-
catchErrors {
100-
try {
101-
worker(workerNumber)
102-
} catch (ex) {
103-
workerFailures << "agent-${agentNumber} worker-${workerNumber}-${j}"
104-
throw ex
105-
}
106-
}
107-
}
108-
}
109-
}
110-
}
111-
112-
return workerMap
113-
}
114-
115134
def getAgentCount(executions) {
116-
// Increase agent count every 24 worker processess, up to 3 agents maximum
117-
return Math.min(3, 1 + floor(executions/24))
135+
// Increase agent count every 20 worker processess, up to 3 agents maximum
136+
return Math.min(3, 1 + floor(executions/20))
118137
}
119138

120139
def trunc(str, length) {

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ node_modules
1515
target
1616
snapshots.js
1717

18+
!/.ci
1819
!/.eslintrc.js
1920
!.storybook
2021

.i18nrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"maps_legacy": "src/plugins/maps_legacy",
3030
"monaco": "packages/kbn-monaco/src",
3131
"presentationUtil": "src/plugins/presentation_util",
32+
"indexPatternFieldEditor": "src/plugins/index_pattern_field_editor",
3233
"indexPatternManagement": "src/plugins/index_pattern_management",
3334
"advancedSettings": "src/plugins/advanced_settings",
3435
"kibana_legacy": "src/plugins/kibana_legacy",
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[[actions-and-connectors-api]]
2+
== Action and connector APIs
3+
4+
Manage Actions and Connectors.
5+
6+
The following action APIs are available:
7+
8+
* <<actions-and-connectors-api-get, Get action API>> to retrieve a single action by ID
9+
10+
* <<actions-and-connectors-api-get-all, Get all actions API>> to retrieve all actions
11+
12+
* <<actions-and-connectors-api-list, List all action types API>> to retrieve a list of all action types
13+
14+
* <<actions-and-connectors-api-create, Create action API>> to create actions
15+
16+
* <<actions-and-connectors-api-update, Update action API>> to update the attributes for an existing action
17+
18+
* <<actions-and-connectors-api-execute, Execute action API>> to execute an action by ID
19+
20+
* <<actions-and-connectors-api-delete, Delete action API>> to delete an action by ID
21+
22+
For information about the actions and connectors that {kib} supports, refer to <<action-types,Action and connector types>>.
23+
24+
include::actions-and-connectors/get.asciidoc[]
25+
include::actions-and-connectors/get_all.asciidoc[]
26+
include::actions-and-connectors/list.asciidoc[]
27+
include::actions-and-connectors/create.asciidoc[]
28+
include::actions-and-connectors/update.asciidoc[]
29+
include::actions-and-connectors/execute.asciidoc[]
30+
include::actions-and-connectors/delete.asciidoc[]
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
[[actions-and-connectors-api-create]]
2+
=== Create action API
3+
++++
4+
<titleabbrev>Create action API</titleabbrev>
5+
++++
6+
7+
Creates an action.
8+
9+
[[actions-and-connectors-api-create-request]]
10+
==== Request
11+
12+
`POST <kibana host>:<port>/api/actions/action`
13+
14+
[[actions-and-connectors-api-create-request-body]]
15+
==== Request body
16+
17+
`name`::
18+
(Required, string) The display name for the action.
19+
20+
`actionTypeId`::
21+
(Required, string) The action type ID for the action.
22+
23+
`config`::
24+
(Required, object) The configuration for the action. Configuration properties vary depending on
25+
the action type. For information about the configuration properties, refer to <<action-types,Action and connector types>>.
26+
27+
`secrets`::
28+
(Required, object) The secrets configuration for the action. Secrets configuration properties vary
29+
depending on the action type. For information about the secrets configuration properties, refer to <<action-types,Action and connector types>>.
30+
31+
[[actions-and-connectors-api-create-request-codes]]
32+
==== Response code
33+
34+
`200`::
35+
Indicates a successful call.
36+
37+
[[actions-and-connectors-api-create-example]]
38+
==== Example
39+
40+
[source,sh]
41+
--------------------------------------------------
42+
$ curl -X POST api/actions/action -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
43+
{
44+
"name": "my-action",
45+
"actionTypeId": ".index",
46+
"config": {
47+
"index": "test-index"
48+
}
49+
}'
50+
--------------------------------------------------
51+
// KIBANA
52+
53+
The API returns the following:
54+
55+
[source,sh]
56+
--------------------------------------------------
57+
{
58+
"id": "c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad",
59+
"actionTypeId": ".index",
60+
"name": "my-action",
61+
"config": {
62+
"index": "test-index",
63+
"refresh": false,
64+
"executionTimeField": null
65+
},
66+
"isPreconfigured": false
67+
}
68+
--------------------------------------------------
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[[actions-and-connectors-api-delete]]
2+
=== Delete action API
3+
++++
4+
<titleabbrev>Delete action API</titleabbrev>
5+
++++
6+
7+
Deletes an action by ID.
8+
9+
WARNING: When you delete an action, _it cannot be recovered_.
10+
11+
[[actions-and-connectors-api-delete-request]]
12+
==== Request
13+
14+
`DELETE <kibana host>:<port>/api/actions/action/<id>`
15+
16+
[[actions-and-connectors-api-delete-path-params]]
17+
==== Path parameters
18+
19+
`id`::
20+
(Required, string) The ID of the action.
21+
22+
[[actions-and-connectors-api-delete-response-codes]]
23+
==== Response code
24+
25+
`200`::
26+
Indicates a successful call.
27+
28+
==== Example
29+
30+
[source,sh]
31+
--------------------------------------------------
32+
$ curl -X DELETE api/actions/action/c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad
33+
--------------------------------------------------
34+
// KIBANA
35+

0 commit comments

Comments
 (0)