Skip to content

Commit 36d65ae

Browse files
Merge branch 'master' into timeline-wordings
2 parents a3c3f5c + 4ab0277 commit 36d65ae

1,337 files changed

Lines changed: 4184054 additions & 13411 deletions

File tree

Some content is hidden

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

.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
"autoMerge": true,

.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) {

.ci/Jenkinsfile_security_cypress

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ kibanaPipeline(timeoutMinutes: 180) {
1717

1818
workers.ci(name: job, size: 'l', ramDisk: true) {
1919
kibanaPipeline.bash('test/scripts/jenkins_xpack_build_kibana.sh', 'Build Default Distributable')
20-
kibanaPipeline.functionalTestProcess(job, 'test/scripts/jenkins_security_solution_cypress.sh')()
20+
kibanaPipeline.functionalTestProcess(job, 'test/scripts/jenkins_security_solution_cypress_chrome.sh')()
21+
kibanaPipeline.functionalTestProcess(job, 'test/scripts/jenkins_security_solution_cypress_firefox.sh')()
2122
}
2223
}
2324
}

.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

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ x-pack/plugins/telemetry_collection_xpack/schema/ @elastic/kibana-core @elastic/
251251
/x-pack/test/security_api_integration/ @elastic/kibana-security
252252
/x-pack/test/security_functional/ @elastic/kibana-security
253253
/x-pack/test/spaces_api_integration/ @elastic/kibana-security
254+
/x-pack/test/saved_object_api_integration/ @elastic/kibana-security
254255
#CC# /x-pack/plugins/security/ @elastic/kibana-security
255256

256257
# Kibana Alerting Services

.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",

CODE_OF_CONDUCT.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
303 See Other
2+
3+
Location: https://www.elastic.co/community/codeofconduct

dev_docs/kibana_platform_plugin_intro.mdx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@ date: 2021-01-06
77
tags: ['kibana','onboarding', 'dev', 'architecture']
88
---
99

10-
From an end user perspective, Kibana is a tool for interacting with Elasticsearch, providing an easy way
10+
From an end user perspective, Kibana is a tool for interacting with Elasticsearch, providing an easy way
1111
to visualize and analyze data.
1212

1313
From a developer perspective, Kibana is a platform that provides a set of tools to build not only the UI you see in Kibana today, but
14-
a wide variety of applications that can be used to explore, visualize, and act upon data in Elasticsearch. The platform provides developers the ability
15-
to build applications, or inject extra functionality into
14+
a wide variety of applications that can be used to explore, visualize, and act upon data in Elasticsearch. The platform provides developers the ability
15+
to build applications, or inject extra functionality into
1616
already existing applications. Did you know that almost everything you see in the
1717
Kibana UI is built inside a plugin? If you removed all plugins from Kibana, you'd be left with an empty navigation menu, and a set of
1818
developer tools. The Kibana platform is a blank canvas, just waiting for a developer to come along and create something!
1919

2020
![Kibana personas](assets/kibana_platform_plugin_end_user.png)
21-
21+
2222
## Platform services
2323

2424
Plugins have access to three kinds of public services:
2525

2626
- Platform services provided by `core` (<DocLink id="kibPlatformIntro" section="core-services" text="Core services"/>)
2727
- Platform services provided by plugins (<DocLink id="kibPlatformIntro" section="platform-plugins" text="Platform plugins"/>)
28-
- Shared services provided by plugins, that are only relevant for only a few, specific plugins (e.g. "presentation utils").
28+
- Shared services provided by plugins, that are only relevant for only a few, specific plugins (e.g. "presentation utils").
2929

3030
The first two items are what make up "Platform services".
3131

@@ -37,9 +37,9 @@ clear, and we haven't done a great job of sticking to it. For example, notificat
3737
Today it looks something like this.
3838

3939
![Core vs platform plugins vs plugins](assets/platform_plugins_core.png)
40-
40+
4141
<DocAccordion buttonContent="A bit of history">
42-
When the Kibana platform and plugin infrastructure was built, we thought of two types of code: core services, and other plugin services. We planned to keep the most stable and fundamental
42+
When the Kibana platform and plugin infrastructure was built, we thought of two types of code: core services, and other plugin services. We planned to keep the most stable and fundamental
4343
code needed to build plugins inside core.
4444

4545
In reality, we ended up with many platform-like services living outside of core, with no (short term) intention of moving them. We highly encourage plugin developers to use
@@ -54,7 +54,7 @@ In reality, our plugin model ended up being used like micro-services. Plugins ar
5454
they desire, without the need to build a plugin.
5555

5656
Another side effect of having many small plugins is that common code often ends up extracted into another plugin. Use case specific utilities are exported,
57-
that are not meant to be used in a general manner. This makes our definition of "platform code" a bit trickier to define. We'd like to say "The platform is made up of
57+
that are not meant to be used in a general manner. This makes our definition of "platform code" a bit trickier to define. We'd like to say "The platform is made up of
5858
every publically exposed service", but in today's world, that wouldn't be a very accurate picture.
5959

6060
We recognize the need to better clarify the relationship between core functionality, platform-like plugin functionality, and functionality exposed by other plugins.
@@ -69,19 +69,19 @@ We will continue to focus on adding clarity around these types of services and w
6969
### Core services
7070

7171
Sometimes referred to just as Core, Core services provide the most basic and fundamental tools neccessary for building a plugin, like creating saved objects,
72-
routing, application registration, and notifications. The Core platform is not a plugin itself, although
72+
routing, application registration, notifications and <DocLink id="kibCoreLogging" text="logging"/>. The Core platform is not a plugin itself, although
7373
there are some plugins that provide platform functionality. We call these <DocLink id="kibPlatformIntro" section="platform-plugins" text="Platform plugins"/>.
7474

7575
### Platform plugins
7676

77-
Plugins that provide fundamental services and functionality to extend and customize Kibana, for example, the
77+
Plugins that provide fundamental services and functionality to extend and customize Kibana, for example, the
7878
<DocLink id="kibDataPlugin" text="data"/> plugin. There is no official way to tell if a plugin is a platform plugin or not.
7979
Platform plugins are _usually_ plugins that are managed by the Platform Group, but we are starting to see some exceptions.
8080

8181
## Plugins
8282

83-
Plugins are code that is written to extend and customize Kibana. Plugin's don't have to be part of the Kibana repo, though the Kibana
84-
repo does contain many plugins! Plugins add customizations by
83+
Plugins are code that is written to extend and customize Kibana. Plugin's don't have to be part of the Kibana repo, though the Kibana
84+
repo does contain many plugins! Plugins add customizations by
8585
using <DocLink id="kibPlatformIntro" section="extension-points" text="extension points"/> provided by <DocLink id="kibPlatformIntro" section="platform-services" text="platform services"/>.
8686
Sometimes people confuse the term "plugin" and "application". While often there is a 1:1 relationship between a plugin and an application, it is not always the case.
8787
A plugin may register many applications, or none.
@@ -97,7 +97,7 @@ adding it to core's application <DocLink id="kibPlatformIntro" section="registry
9797

9898
### Public plugin API
9999

100-
A plugin's public API consists of everything exported from a plugin's <DocLink id="kibPlatformIntro" section="plugin-lifecycle" text="start or setup lifecycle methods"/>,
100+
A plugin's public API consists of everything exported from a plugin's <DocLink id="kibPlatformIntro" section="plugin-lifecycle" text="start or setup lifecycle methods"/>,
101101
as well as from the top level `index.ts` files that exist in the three "scope" folders:
102102

103103
- common/index.ts
@@ -113,18 +113,18 @@ Core, and plugins, expose different features at different parts of their lifecyc
113113
specifically-named functions on the service definition.
114114

115115
Kibana has three lifecycles: setup, start, and stop. Each plugin’s setup function is called sequentially while Kibana is setting up
116-
on the server or when it is being loaded in the browser. The start functions are called sequentially after setup has been completed for all plugins.
116+
on the server or when it is being loaded in the browser. The start functions are called sequentially after setup has been completed for all plugins.
117117
The stop functions are called sequentially while Kibana is gracefully shutting down the server or when the browser tab or window is being closed.
118118

119119
The table below explains how each lifecycle relates to the state of Kibana.
120120

121121
| lifecycle | purpose | server | browser |
122122
| ---------- | ------ | ------- | ----- |
123123
| setup | perform "registration" work to setup environment for runtime |configure REST API endpoint, register saved object types, etc. | configure application routes in SPA, register custom UI elements in extension points, etc. |
124-
| start | bootstrap runtime logic | respond to an incoming request, request Elasticsearch server, etc. | start polling Kibana server, update DOM tree in response to user interactions, etc.|
124+
| start | bootstrap runtime logic | respond to an incoming request, request Elasticsearch server, etc. | start polling Kibana server, update DOM tree in response to user interactions, etc.|
125125
| stop | cleanup runtime | dispose of active handles before the server shutdown. | store session data in the LocalStorage when the user navigates away from Kibana, etc. |
126126

127-
Different service interfaces can and will be passed to setup, start, and stop because certain functionality makes sense in the context of a running plugin while other types
127+
Different service interfaces can and will be passed to setup, start, and stop because certain functionality makes sense in the context of a running plugin while other types
128128
of functionality may have restrictions or may only make sense in the context of a plugin that is stopping.
129129

130130
## Extension points
@@ -141,4 +141,4 @@ plugins to customize the Kibana experience. Examples of extension points are:
141141

142142
## Follow up material
143143

144-
Learn how to build your own plugin by following <DocLink id="kibDevTutorialBuildAPlugin" />
144+
Learn how to build your own plugin by following <DocLink id="kibDevTutorialBuildAPlugin" />

0 commit comments

Comments
 (0)