Skip to content

Commit 1e2435b

Browse files
Merge branch 'drilldowns' into drilldown-demo-2
2 parents 076f2d7 + ad1b02a commit 1e2435b

File tree

2,600 files changed

+38082
-31360
lines changed

Some content is hidden

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

2,600 files changed

+38082
-31360
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ bower_components
1010
/html_docs
1111
/src/plugins/data/common/es_query/kuery/ast/_generated_/**
1212
/src/plugins/vis_type_timelion/public/_generated_/**
13-
src/legacy/core_plugins/vis_type_vislib/public/vislib/__tests__/lib/fixtures/mock_data
1413
/src/legacy/ui/public/flot-charts
1514
/test/fixtures/scenarios
1615
/src/legacy/core_plugins/console/public/webpackShims

.eslintrc.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ module.exports = {
217217
'examples/**/*',
218218
'!(src|x-pack)/**/*.test.*',
219219
'!(x-pack/)?test/**/*',
220+
// next folder contains legacy browser tests which can't be migrated to jest
221+
// which import np files
222+
'!src/legacy/core_plugins/kibana/public/__tests__/**/*',
220223
],
221224
from: [
222225
'(src|x-pack)/plugins/**/(public|server)/**/*',
@@ -562,7 +565,7 @@ module.exports = {
562565
*/
563566
{
564567
// front end typescript and javascript files only
565-
files: ['x-pack/legacy/plugins/siem/public/**/*.{js,ts,tsx}'],
568+
files: ['x-pack/plugins/siem/public/**/*.{js,ts,tsx}'],
566569
rules: {
567570
'import/no-nodejs-modules': 'error',
568571
'no-restricted-imports': [
@@ -611,7 +614,7 @@ module.exports = {
611614
// {
612615
// // will introduced after the other warns are fixed
613616
// // typescript and javascript for front end react performance
614-
// files: ['x-pack/legacy/plugins/siem/public/**/!(*.test).{js,ts,tsx}'],
617+
// files: ['x-pack/plugins/siem/public/**/!(*.test).{js,ts,tsx}'],
615618
// plugins: ['react-perf'],
616619
// rules: {
617620
// // 'react-perf/jsx-no-new-object-as-prop': 'error',

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/src/legacy/core_plugins/kibana/public/discover/ @elastic/kibana-app
1313
/src/legacy/core_plugins/kibana/public/local_application_service/ @elastic/kibana-app
1414
/src/legacy/core_plugins/kibana/public/dev_tools/ @elastic/kibana-app
15-
/src/legacy/core_plugins/vis_type_vislib/ @elastic/kibana-app
15+
/src/plugins/vis_type_vislib/ @elastic/kibana-app
1616
/src/plugins/vis_type_xy/ @elastic/kibana-app
1717
/src/plugins/vis_type_table/ @elastic/kibana-app
1818
/src/plugins/kibana_legacy/ @elastic/kibana-app

.i18nrc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@
5151
"visTypeMetric": "src/plugins/vis_type_metric",
5252
"visTypeTable": "src/plugins/vis_type_table",
5353
"visTypeTagCloud": "src/plugins/vis_type_tagcloud",
54-
"visTypeTimeseries": ["src/legacy/core_plugins/vis_type_timeseries", "src/plugins/vis_type_timeseries"],
54+
"visTypeTimeseries": "src/plugins/vis_type_timeseries",
5555
"visTypeVega": "src/plugins/vis_type_vega",
56-
"visTypeVislib": "src/legacy/core_plugins/vis_type_vislib",
57-
"visTypeXy": "src/legacy/core_plugins/vis_type_xy",
56+
"visTypeVislib": "src/plugins/vis_type_vislib",
57+
"visTypeXy": "src/plugins/vis_type_xy",
5858
"visualizations": "src/plugins/visualizations",
5959
"visualize": "src/plugins/visualize"
6060
},

.sass-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ files:
22
include:
33
- 'src/legacy/core_plugins/metrics/**/*.s+(a|c)ss'
44
- 'src/legacy/core_plugins/timelion/**/*.s+(a|c)ss'
5-
- 'src/legacy/core_plugins/vis_type_vislib/**/*.s+(a|c)ss'
6-
- 'src/legacy/core_plugins/vis_type_xy/**/*.s+(a|c)ss'
5+
- 'src/plugins/vis_type_vislib/**/*.s+(a|c)ss'
6+
- 'src/plugins/vis_type_xy/**/*.s+(a|c)ss'
77
- 'x-pack/legacy/plugins/security/**/*.s+(a|c)ss'
88
- 'x-pack/legacy/plugins/canvas/**/*.s+(a|c)ss'
99
- 'x-pack/plugins/triggers_actions_ui/**/*.s+(a|c)ss'

Jenkinsfile

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

66
kibanaPipeline(timeoutMinutes: 135, checkPrChanges: true) {
7-
githubPr.withDefaultPrComments {
8-
catchError {
9-
retryable.enable()
10-
parallel([
11-
'kibana-intake-agent': workers.intake('kibana-intake', './test/scripts/jenkins_unit.sh'),
12-
'x-pack-intake-agent': workers.intake('x-pack-intake', './test/scripts/jenkins_xpack.sh'),
13-
'kibana-oss-agent': workers.functional('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
14-
'oss-firefoxSmoke': kibanaPipeline.functionalTestProcess('kibana-firefoxSmoke', './test/scripts/jenkins_firefox_smoke.sh'),
15-
'oss-ciGroup1': kibanaPipeline.ossCiGroupProcess(1),
16-
'oss-ciGroup2': kibanaPipeline.ossCiGroupProcess(2),
17-
'oss-ciGroup3': kibanaPipeline.ossCiGroupProcess(3),
18-
'oss-ciGroup4': kibanaPipeline.ossCiGroupProcess(4),
19-
'oss-ciGroup5': kibanaPipeline.ossCiGroupProcess(5),
20-
'oss-ciGroup6': kibanaPipeline.ossCiGroupProcess(6),
21-
'oss-ciGroup7': kibanaPipeline.ossCiGroupProcess(7),
22-
'oss-ciGroup8': kibanaPipeline.ossCiGroupProcess(8),
23-
'oss-ciGroup9': kibanaPipeline.ossCiGroupProcess(9),
24-
'oss-ciGroup10': kibanaPipeline.ossCiGroupProcess(10),
25-
'oss-ciGroup11': kibanaPipeline.ossCiGroupProcess(11),
26-
'oss-ciGroup12': kibanaPipeline.ossCiGroupProcess(12),
27-
'oss-accessibility': kibanaPipeline.functionalTestProcess('kibana-accessibility', './test/scripts/jenkins_accessibility.sh'),
28-
// 'oss-visualRegression': kibanaPipeline.functionalTestProcess('visualRegression', './test/scripts/jenkins_visual_regression.sh'),
29-
]),
30-
'kibana-xpack-agent': workers.functional('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
31-
'xpack-firefoxSmoke': kibanaPipeline.functionalTestProcess('xpack-firefoxSmoke', './test/scripts/jenkins_xpack_firefox_smoke.sh'),
32-
'xpack-ciGroup1': kibanaPipeline.xpackCiGroupProcess(1),
33-
'xpack-ciGroup2': kibanaPipeline.xpackCiGroupProcess(2),
34-
'xpack-ciGroup3': kibanaPipeline.xpackCiGroupProcess(3),
35-
'xpack-ciGroup4': kibanaPipeline.xpackCiGroupProcess(4),
36-
'xpack-ciGroup5': kibanaPipeline.xpackCiGroupProcess(5),
37-
'xpack-ciGroup6': kibanaPipeline.xpackCiGroupProcess(6),
38-
'xpack-ciGroup7': kibanaPipeline.xpackCiGroupProcess(7),
39-
'xpack-ciGroup8': kibanaPipeline.xpackCiGroupProcess(8),
40-
'xpack-ciGroup9': kibanaPipeline.xpackCiGroupProcess(9),
41-
'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10),
42-
'xpack-accessibility': kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh'),
43-
'xpack-siemCypress': { processNumber ->
44-
whenChanged(['x-pack/plugins/siem/', 'x-pack/legacy/plugins/siem/', 'x-pack/test/siem_cypress/']) {
45-
kibanaPipeline.functionalTestProcess('xpack-siemCypress', './test/scripts/jenkins_siem_cypress.sh')(processNumber)
46-
}
47-
},
7+
ciStats.trackBuild {
8+
githubPr.withDefaultPrComments {
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-siemCypress': { processNumber ->
45+
whenChanged(['x-pack/plugins/siem/', 'x-pack/test/siem_cypress/']) {
46+
kibanaPipeline.functionalTestProcess('xpack-siemCypress', './test/scripts/jenkins_siem_cypress.sh')(processNumber)
47+
}
48+
},
4849

49-
// 'xpack-visualRegression': kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh'),
50-
]),
51-
])
50+
// 'xpack-visualRegression': kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh'),
51+
]),
52+
])
53+
}
5254
}
53-
}
5455

55-
retryable.printFlakyFailures()
56-
kibanaPipeline.sendMail()
56+
retryable.printFlakyFailures()
57+
kibanaPipeline.sendMail()
58+
}
5759
}

docs/developer/core-development.asciidoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* <<development-elasticsearch>>
88
* <<development-unit-tests>>
99
* <<development-functional-tests>>
10+
* <<development-es-snapshots>>
1011

1112
include::core/development-basepath.asciidoc[]
1213

@@ -19,3 +20,5 @@ include::core/development-elasticsearch.asciidoc[]
1920
include::core/development-unit-tests.asciidoc[]
2021

2122
include::core/development-functional-tests.asciidoc[]
23+
24+
include::core/development-es-snapshots.asciidoc[]
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
[[development-es-snapshots]]
2+
=== Daily Elasticsearch Snapshots
3+
4+
For local development and CI, Kibana, by default, uses Elasticsearch snapshots that are built daily when running tasks that require Elasticsearch (e.g. functional tests).
5+
6+
A snapshot is just a group of tarballs, one for each supported distribution/architecture/os of Elasticsearch, and a JSON-based manifest file containing metadata about the distributions.
7+
8+
https://ci.kibana.dev/es-snapshots[A dashboard] is available that shows the current status and compatibility of the latest Elasticsearch snapshots.
9+
10+
==== Process Overview
11+
12+
1. Elasticsearch snapshots are built for each current tracked branch of Kibana.
13+
2. Each snapshot is uploaded to a public Google Cloud Storage bucket, `kibana-ci-es-snapshots-daily`.
14+
** At this point, the snapshot is not automatically used in CI or local development. It needs to be tested/verified first.
15+
3. Each snapshot is tested with the latest commit of the corresponding Kibana branch, using the full CI suite.
16+
4. After CI
17+
** If the snapshot passes, it is promoted and automatically used in CI and local development.
18+
** If the snapshot fails, the issue must be investigated and resolved. A new incompatibility may exist between Elasticsearch and Kibana.
19+
20+
==== Using the latest snapshot
21+
22+
When developing locally, you may wish to use the most recent Elasticsearch snapshot, even if it's failing CI. To do so, prefix your commands with the follow environment variable:
23+
24+
["source","bash"]
25+
-----------
26+
KBN_ES_SNAPSHOT_USE_UNVERIFIED=true
27+
-----------
28+
29+
You can use this flag with any command that downloads and runs Elasticsearch snapshots, such as `scripts/es` or the FTR.
30+
31+
For example, to run functional tests with the latest snapshot:
32+
33+
["source","bash"]
34+
-----------
35+
KBN_ES_SNAPSHOT_USE_UNVERIFIED=true node scripts/functional_tests_server
36+
-----------
37+
38+
===== For Pull Requests
39+
40+
Currently, there is not a way to run your pull request with the latest unverified snapshot without a code change. You can, however, do it with a small code change.
41+
42+
1. Edit `Jenkinsfile` in the root of the Kibana repo
43+
2. Add `env.KBN_ES_SNAPSHOT_USE_UNVERIFIED = 'true'` at the top of the file.
44+
3. Commit the change
45+
46+
Your pull request should then use the latest snapshot the next time that it runs. Just don't merge the change to `Jenkinsfile`!
47+
48+
==== Google Cloud Storage buckets
49+
50+
===== kibana-ci-es-snapshots-daily
51+
52+
This bucket stores snapshots that are created on a daily basis, and is the primary location used by `kbn-es` to download snapshots.
53+
54+
Snapshots are automatically deleted after 10 days.
55+
56+
The file structure for this bucket looks like this:
57+
58+
* `<version>/manifest-latest.json`
59+
* `<version>/manifest-latest-verified.json`
60+
* `<version>/archives/<unique id>/*.tar.gz`
61+
* `<version>/archives/<unique id>/*.tar.gz.sha512`
62+
* `<version>/archives/<unique id>/manifest.json`
63+
64+
===== kibana-ci-es-snapshots-permanent
65+
66+
This bucket stores only the most recently promoted snapshot for each version. Old snapshots are only deleted when new ones are uploaded.
67+
68+
This bucket serves as permanent snapshot storage for old branches/versions that are no longer being built. `kbn-es` checks the daily bucket first, followed by this one if no snapshots were found.
69+
70+
The file structure for this bucket looks like this:
71+
72+
* `<version>/*.tar.gz`
73+
* `<version>/*.tar.gz.sha512`
74+
* `<version>/manifest.json`
75+
76+
==== How snapshots are built, tested, and promoted
77+
78+
Each day, a https://kibana-ci.elastic.co/job/elasticsearch+snapshots+trigger/[Jenkins job] runs that triggers Elasticsearch builds for each currently tracked branch/version. This job is automatically updated with the correct branches whenever we release new versions of Kibana.
79+
80+
===== Build
81+
82+
https://kibana-ci.elastic.co/job/elasticsearch+snapshots+build/[This Jenkins job] builds the Elasticsearch snapshots and uploads them to GCS.
83+
84+
The Jenkins job pipeline definition is https://github.com/elastic/kibana/blob/master/.ci/es-snapshots/Jenkinsfile_build_es[in the kibana repo].
85+
86+
1. Checkout Elasticsearch repo for the given branch/version.
87+
2. Run `./gradlew -p distribution/archives assemble --parallel` to create all of the Elasticsearch distributions.
88+
3. Create a tarball for each distribution.
89+
4. Create a manifest JSON file containing info about the distribution, as well as its download URL.
90+
5. Upload the tarballs and manifest to a unique location in the GCS bucket `kibana-ci-es-snapshots-daily`.
91+
** e.g. `<version>/archives/<unique id>`
92+
6. Replace `<version>/manifest-latest.json` in GCS with this newest manifest.
93+
** This allows the `KBN_ES_SNAPSHOT_USE_UNVERIFIED` flag to work.
94+
7. Trigger the verification job, to run the full Kibana CI test suite with this snapshot.
95+
96+
===== Verification and Promotion
97+
98+
https://kibana-ci.elastic.co/job/elasticsearch+snapshots+verify/[This Jenkins job] tests the latest Elasticsearch snapshot with the full Kibana CI pipeline, and promotes if it there are no test failures.
99+
100+
The Jenkins job pipeline definition is https://github.com/elastic/kibana/blob/master/.ci/es-snapshots/Jenkinsfile_verify_es[in the kibana repo].
101+
102+
1. Checkout Kibana and set up CI environment as normal.
103+
2. Set the `ES_SNAPSHOT_MANIFEST` env var to point to the latest snapshot manifest.
104+
3. Run CI (functional tests, integration tests, etc).
105+
4. After CI
106+
** If there was a test failure or other build error, send out an e-mail notification and stop.
107+
** If there were no errors, promote the snapshot.
108+
109+
Promotion is done as part of the same pipeline:
110+
111+
1. Replace the manifest at `kibana-ci-es-snapshots-daily/<version>/manifest-latest-verified.json` with the manifest from the tested snapshot.
112+
** At this point, the snapshot has been promoted and will automatically be used in CI and in local development.
113+
2. Replace the snapshot at `kibana-ci-es-snapshots-permanent/<version>/` with the tested snapshot by copying all of the tarballs and the manifest file.

0 commit comments

Comments
 (0)