Skip to content

Commit e602cfc

Browse files
Merge branch 'master' into shim-oss-telemetry
2 parents 96d6859 + 8fb8ef9 commit e602cfc

File tree

974 files changed

+23030
-11103
lines changed

Some content is hidden

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

974 files changed

+23030
-11103
lines changed

.ci/end2end.groovy

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
#!/usr/bin/env groovy
2+
3+
library identifier: 'apm@current',
4+
retriever: modernSCM(
5+
[$class: 'GitSCMSource',
6+
credentialsId: 'f94e9298-83ae-417e-ba91-85c279771570',
7+
id: '37cf2c00-2cc7-482e-8c62-7bbffef475e2',
8+
remote: 'git@github.com:elastic/apm-pipeline-library.git'])
9+
10+
pipeline {
11+
agent { label 'linux && immutable' }
12+
environment {
13+
BASE_DIR = 'src/github.com/elastic/kibana'
14+
HOME = "${env.WORKSPACE}"
15+
APM_ITS = 'apm-integration-testing'
16+
CYPRESS_DIR = 'x-pack/legacy/plugins/apm/cypress'
17+
PIPELINE_LOG_LEVEL = 'DEBUG'
18+
}
19+
options {
20+
timeout(time: 1, unit: 'HOURS')
21+
buildDiscarder(logRotator(numToKeepStr: '40', artifactNumToKeepStr: '20', daysToKeepStr: '30'))
22+
timestamps()
23+
ansiColor('xterm')
24+
disableResume()
25+
durabilityHint('PERFORMANCE_OPTIMIZED')
26+
}
27+
triggers {
28+
issueCommentTrigger('(?i).*jenkins\\W+run\\W+(?:the\\W+)?e2e(?:\\W+please)?.*')
29+
}
30+
parameters {
31+
booleanParam(name: 'FORCE', defaultValue: false, description: 'Whether to force the run.')
32+
}
33+
stages {
34+
stage('Checkout') {
35+
options { skipDefaultCheckout() }
36+
steps {
37+
deleteDir()
38+
gitCheckout(basedir: "${BASE_DIR}", githubNotifyFirstTimeContributor: false,
39+
shallow: false, reference: "/var/lib/jenkins/.git-references/kibana.git")
40+
script {
41+
dir("${BASE_DIR}"){
42+
def regexps =[ "^x-pack/legacy/plugins/apm/.*" ]
43+
env.APM_UPDATED = isGitRegionMatch(patterns: regexps)
44+
}
45+
}
46+
dir("${APM_ITS}"){
47+
git changelog: false,
48+
credentialsId: 'f6c7695a-671e-4f4f-a331-acdce44ff9ba',
49+
poll: false,
50+
url: "git@github.com:elastic/${APM_ITS}.git"
51+
}
52+
}
53+
}
54+
stage('Start services') {
55+
options { skipDefaultCheckout() }
56+
when {
57+
anyOf {
58+
expression { return params.FORCE }
59+
expression { return env.APM_UPDATED != "false" }
60+
}
61+
}
62+
steps {
63+
dir("${APM_ITS}"){
64+
sh './scripts/compose.py start master --no-kibana --no-xpack-secure'
65+
}
66+
}
67+
}
68+
stage('Prepare Kibana') {
69+
options { skipDefaultCheckout() }
70+
when {
71+
anyOf {
72+
expression { return params.FORCE }
73+
expression { return env.APM_UPDATED != "false" }
74+
}
75+
}
76+
environment {
77+
JENKINS_NODE_COOKIE = 'dontKillMe'
78+
}
79+
steps {
80+
dir("${BASE_DIR}"){
81+
sh script: "${CYPRESS_DIR}/ci/prepare-kibana.sh"
82+
}
83+
}
84+
}
85+
stage('Smoke Tests'){
86+
options { skipDefaultCheckout() }
87+
when {
88+
anyOf {
89+
expression { return params.FORCE }
90+
expression { return env.APM_UPDATED != "false" }
91+
}
92+
}
93+
steps{
94+
dir("${BASE_DIR}"){
95+
sh '''
96+
jobs -l
97+
docker build --tag cypress ${CYPRESS_DIR}/ci
98+
docker run --rm -t --user "$(id -u):$(id -g)" \
99+
-v `pwd`:/app --network="host" \
100+
--name cypress cypress'''
101+
}
102+
}
103+
post {
104+
always {
105+
dir("${BASE_DIR}"){
106+
archiveArtifacts(allowEmptyArchive: false, artifacts: "${CYPRESS_DIR}/screenshots/**,${CYPRESS_DIR}/videos/**,${CYPRESS_DIR}/*e2e-tests.xml")
107+
junit(allowEmptyResults: true, testResults: "${CYPRESS_DIR}/*e2e-tests.xml")
108+
}
109+
dir("${APM_ITS}"){
110+
sh 'docker-compose logs > apm-its.log || true'
111+
sh 'docker-compose down -v || true'
112+
archiveArtifacts(allowEmptyArchive: false, artifacts: 'apm-its.log')
113+
}
114+
}
115+
}
116+
}
117+
}
118+
post {
119+
always {
120+
dir("${BASE_DIR}"){
121+
archiveArtifacts(allowEmptyArchive: true, artifacts: "${CYPRESS_DIR}/ingest-data.log,kibana.log")
122+
}
123+
}
124+
}
125+
}

.eslintrc.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,6 @@ module.exports = {
163163
'jsx-a11y/click-events-have-key-events': 'off',
164164
},
165165
},
166-
{
167-
files: ['x-pack/legacy/plugins/graph/**/*.{js,ts,tsx}'],
168-
rules: {
169-
'react-hooks/exhaustive-deps': 'off',
170-
},
171-
},
172166
{
173167
files: ['x-pack/legacy/plugins/index_management/**/*.{js,ts,tsx}'],
174168
rules: {

.github/CODEOWNERS

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# App
66
/x-pack/legacy/plugins/lens/ @elastic/kibana-app
77
/x-pack/legacy/plugins/graph/ @elastic/kibana-app
8+
/src/legacy/server/sample_data/ @elastic/kibana-app
89

910
# App Architecture
1011
/src/plugins/data/ @elastic/kibana-app-arch
@@ -66,14 +67,25 @@
6667
/packages/kbn-es/ @elastic/kibana-operations
6768
/packages/kbn-pm/ @elastic/kibana-operations
6869
/packages/kbn-test/ @elastic/kibana-operations
70+
/src/legacy/server/keystore/ @elastic/kibana-operations
71+
/src/legacy/server/pid/ @elastic/kibana-operations
72+
/src/legacy/server/sass/ @elastic/kibana-operations
73+
/src/legacy/server/utils/ @elastic/kibana-operations
74+
/src/legacy/server/warnings/ @elastic/kibana-operations
6975

7076
# Platform
7177
/src/core/ @elastic/kibana-platform
72-
/src/legacy/server/saved_objects/ @elastic/kibana-platform
7378
/config/kibana.yml @elastic/kibana-platform
7479
/x-pack/plugins/features/ @elastic/kibana-platform
7580
/x-pack/plugins/licensing/ @elastic/kibana-platform
7681
/packages/kbn-config-schema/ @elastic/kibana-platform
82+
/src/legacy/server/config/ @elastic/kibana-platform
83+
/src/legacy/server/csp/ @elastic/kibana-platform
84+
/src/legacy/server/http/ @elastic/kibana-platform
85+
/src/legacy/server/i18n/ @elastic/kibana-platform
86+
/src/legacy/server/logging/ @elastic/kibana-platform
87+
/src/legacy/server/saved_objects/ @elastic/kibana-platform
88+
/src/legacy/server/status/ @elastic/kibana-platform
7789

7890
# Security
7991
/x-pack/legacy/plugins/security/ @elastic/kibana-security

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ disabledPlugins
2929
webpackstats.json
3030
/config/*
3131
!/config/kibana.yml
32+
!/config/apm.js
3233
coverage
3334
selenium
3435
.babel_register_cache.json

.i18nrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"kbnVislibVisTypes": "src/legacy/core_plugins/kbn_vislib_vis_types",
2020
"kibana_react": "src/legacy/core_plugins/kibana_react",
2121
"kibana-react": "src/plugins/kibana_react",
22+
"kibana_utils": "src/plugins/kibana_utils",
2223
"navigation": "src/legacy/core_plugins/navigation",
2324
"newsfeed": "src/plugins/newsfeed",
2425
"regionMap": "src/legacy/core_plugins/region_map",

CONTRIBUTING.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ A high level overview of our contributing guidelines.
2424
- [Internationalization](#internationalization)
2525
- [Testing and Building](#testing-and-building)
2626
- [Debugging server code](#debugging-server-code)
27+
- [Instrumenting with Elastic APM](#instrumenting-with-elastic-apm)
2728
- [Debugging Unit Tests](#debugging-unit-tests)
2829
- [Unit Testing Plugins](#unit-testing-plugins)
2930
- [Cross-browser compatibility](#cross-browser-compatibility)
@@ -374,6 +375,29 @@ macOS users on a machine with a discrete graphics card may see significant speed
374375
### Debugging Server Code
375376
`yarn debug` will start the server with Node's inspect flag. Kibana's development mode will start three processes on ports `9229`, `9230`, and `9231`. Chrome's developer tools need to be configured to connect to all three connections. Add `localhost:<port>` for each Kibana process in Chrome's developer tools connection tab.
376377

378+
### Instrumenting with Elastic APM
379+
Kibana ships with the [Elastic APM Node.js Agent](https://github.com/elastic/apm-agent-nodejs) built-in for debugging purposes.
380+
381+
Its default configuration is meant to be used by core Kibana developers only, but it can easily be re-configured to your needs.
382+
In its default configuration it's disabled and will, once enabled, send APM data to a centrally managed Elasticsearch cluster accessible only to Elastic employees.
383+
384+
To change the location where data is sent, use the [`serverUrl`](https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuration.html#server-url) APM config option.
385+
To activate the APM agent, use the [`active`](https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuration.html#active) APM config option.
386+
387+
All config options can be set either via environment variables, or by creating an appropriate config file under `config/apm.dev.js`.
388+
For more information about configuring the APM agent, please refer to [the documentation](https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuring-the-agent.html).
389+
390+
Example `config/apm.dev.js` file:
391+
392+
```js
393+
module.exports = {
394+
active: true,
395+
};
396+
```
397+
398+
Once the agent is active, it will trace all incoming HTTP requests to Kibana, monitor for errors, and collect process-level metrics.
399+
The collected data will be sent to the APM Server and is viewable in the APM UI in Kibana.
400+
377401
### Unit testing frameworks
378402
Kibana is migrating unit testing from Mocha to Jest. Legacy unit tests still
379403
exist in Mocha but all new unit tests should be written in Jest. Mocha tests
@@ -389,7 +413,7 @@ The following table outlines possible test file locations and how to invoke them
389413
| Jest | `src/**/*.test.js`<br>`src/**/*.test.ts` | `node scripts/jest -t regexp [test path]` |
390414
| Jest (integration) | `**/integration_tests/**/*.test.js` | `node scripts/jest_integration -t regexp [test path]` |
391415
| Mocha | `src/**/__tests__/**/*.js`<br>`!src/**/public/__tests__/*.js`<br>`packages/kbn-datemath/test/**/*.js`<br>`packages/kbn-dev-utils/src/**/__tests__/**/*.js`<br>`tasks/**/__tests__/**/*.js` | `node scripts/mocha --grep=regexp [test path]` |
392-
| Functional | `test/*integration/**/config.js`<br>`test/*functional/**/config.js` | `node scripts/functional_tests_server --config test/[directory]/config.js`<br>`node scripts/functional_test_runner --config test/[directory]/config.js --grep=regexp` |
416+
| Functional | `test/*integration/**/config.js`<br>`test/*functional/**/config.js`<br>`test/accessibility/config.js` | `node scripts/functional_tests_server --config test/[directory]/config.js`<br>`node scripts/functional_test_runner --config test/[directory]/config.js --grep=regexp` |
393417
| Karma | `src/**/public/__tests__/*.js` | `npm run test:dev` |
394418

395419
For X-Pack tests located in `x-pack/` see [X-Pack Testing](x-pack/README.md#testing)

Jenkinsfile

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,43 +7,45 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
77
timeout(time: 120, unit: 'MINUTES') {
88
timestamps {
99
ansiColor('xterm') {
10-
catchError {
11-
parallel([
12-
'kibana-intake-agent': kibanaPipeline.legacyJobRunner('kibana-intake'),
13-
'x-pack-intake-agent': kibanaPipeline.legacyJobRunner('x-pack-intake'),
14-
'kibana-oss-agent': kibanaPipeline.withWorkers('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
15-
'oss-firefoxSmoke': kibanaPipeline.getPostBuildWorker('firefoxSmoke', { runbld('./test/scripts/jenkins_firefox_smoke.sh', 'Execute kibana-firefoxSmoke') }),
16-
'oss-ciGroup1': kibanaPipeline.getOssCiGroupWorker(1),
17-
'oss-ciGroup2': kibanaPipeline.getOssCiGroupWorker(2),
18-
'oss-ciGroup3': kibanaPipeline.getOssCiGroupWorker(3),
19-
'oss-ciGroup4': kibanaPipeline.getOssCiGroupWorker(4),
20-
'oss-ciGroup5': kibanaPipeline.getOssCiGroupWorker(5),
21-
'oss-ciGroup6': kibanaPipeline.getOssCiGroupWorker(6),
22-
'oss-ciGroup7': kibanaPipeline.getOssCiGroupWorker(7),
23-
'oss-ciGroup8': kibanaPipeline.getOssCiGroupWorker(8),
24-
'oss-ciGroup9': kibanaPipeline.getOssCiGroupWorker(9),
25-
'oss-ciGroup10': kibanaPipeline.getOssCiGroupWorker(10),
26-
'oss-ciGroup11': kibanaPipeline.getOssCiGroupWorker(11),
27-
'oss-ciGroup12': kibanaPipeline.getOssCiGroupWorker(12),
28-
'oss-accessibility': kibanaPipeline.getPostBuildWorker('accessibility', { runbld('./test/scripts/jenkins_accessibility.sh', 'Execute kibana-accessibility') }),
29-
// 'oss-visualRegression': kibanaPipeline.getPostBuildWorker('visualRegression', { runbld('./test/scripts/jenkins_visual_regression.sh', 'Execute kibana-visualRegression') }),
30-
]),
31-
'kibana-xpack-agent': kibanaPipeline.withWorkers('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
32-
'xpack-firefoxSmoke': kibanaPipeline.getPostBuildWorker('xpack-firefoxSmoke', { runbld('./test/scripts/jenkins_xpack_firefox_smoke.sh', 'Execute xpack-firefoxSmoke') }),
33-
'xpack-ciGroup1': kibanaPipeline.getXpackCiGroupWorker(1),
34-
'xpack-ciGroup2': kibanaPipeline.getXpackCiGroupWorker(2),
35-
'xpack-ciGroup3': kibanaPipeline.getXpackCiGroupWorker(3),
36-
'xpack-ciGroup4': kibanaPipeline.getXpackCiGroupWorker(4),
37-
'xpack-ciGroup5': kibanaPipeline.getXpackCiGroupWorker(5),
38-
'xpack-ciGroup6': kibanaPipeline.getXpackCiGroupWorker(6),
39-
'xpack-ciGroup7': kibanaPipeline.getXpackCiGroupWorker(7),
40-
'xpack-ciGroup8': kibanaPipeline.getXpackCiGroupWorker(8),
41-
'xpack-ciGroup9': kibanaPipeline.getXpackCiGroupWorker(9),
42-
'xpack-ciGroup10': kibanaPipeline.getXpackCiGroupWorker(10),
43-
'xpack-accessibility': kibanaPipeline.getPostBuildWorker('xpack-accessibility', { runbld('./test/scripts/jenkins_xpack_accessibility.sh', 'Execute xpack-accessibility') }),
44-
// 'xpack-visualRegression': kibanaPipeline.getPostBuildWorker('xpack-visualRegression', { runbld('./test/scripts/jenkins_xpack_visual_regression.sh', 'Execute xpack-visualRegression') }),
45-
]),
46-
])
10+
githubPr.withDefaultPrComments {
11+
catchError {
12+
parallel([
13+
'kibana-intake-agent': kibanaPipeline.legacyJobRunner('kibana-intake'),
14+
'x-pack-intake-agent': kibanaPipeline.legacyJobRunner('x-pack-intake'),
15+
'kibana-oss-agent': kibanaPipeline.withWorkers('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
16+
'oss-firefoxSmoke': kibanaPipeline.getPostBuildWorker('firefoxSmoke', { runbld('./test/scripts/jenkins_firefox_smoke.sh', 'Execute kibana-firefoxSmoke') }),
17+
'oss-ciGroup1': kibanaPipeline.getOssCiGroupWorker(1),
18+
'oss-ciGroup2': kibanaPipeline.getOssCiGroupWorker(2),
19+
'oss-ciGroup3': kibanaPipeline.getOssCiGroupWorker(3),
20+
'oss-ciGroup4': kibanaPipeline.getOssCiGroupWorker(4),
21+
'oss-ciGroup5': kibanaPipeline.getOssCiGroupWorker(5),
22+
'oss-ciGroup6': kibanaPipeline.getOssCiGroupWorker(6),
23+
'oss-ciGroup7': kibanaPipeline.getOssCiGroupWorker(7),
24+
'oss-ciGroup8': kibanaPipeline.getOssCiGroupWorker(8),
25+
'oss-ciGroup9': kibanaPipeline.getOssCiGroupWorker(9),
26+
'oss-ciGroup10': kibanaPipeline.getOssCiGroupWorker(10),
27+
'oss-ciGroup11': kibanaPipeline.getOssCiGroupWorker(11),
28+
'oss-ciGroup12': kibanaPipeline.getOssCiGroupWorker(12),
29+
'oss-accessibility': kibanaPipeline.getPostBuildWorker('accessibility', { runbld('./test/scripts/jenkins_accessibility.sh', 'Execute kibana-accessibility') }),
30+
// 'oss-visualRegression': kibanaPipeline.getPostBuildWorker('visualRegression', { runbld('./test/scripts/jenkins_visual_regression.sh', 'Execute kibana-visualRegression') }),
31+
]),
32+
'kibana-xpack-agent': kibanaPipeline.withWorkers('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
33+
'xpack-firefoxSmoke': kibanaPipeline.getPostBuildWorker('xpack-firefoxSmoke', { runbld('./test/scripts/jenkins_xpack_firefox_smoke.sh', 'Execute xpack-firefoxSmoke') }),
34+
'xpack-ciGroup1': kibanaPipeline.getXpackCiGroupWorker(1),
35+
'xpack-ciGroup2': kibanaPipeline.getXpackCiGroupWorker(2),
36+
'xpack-ciGroup3': kibanaPipeline.getXpackCiGroupWorker(3),
37+
'xpack-ciGroup4': kibanaPipeline.getXpackCiGroupWorker(4),
38+
'xpack-ciGroup5': kibanaPipeline.getXpackCiGroupWorker(5),
39+
'xpack-ciGroup6': kibanaPipeline.getXpackCiGroupWorker(6),
40+
'xpack-ciGroup7': kibanaPipeline.getXpackCiGroupWorker(7),
41+
'xpack-ciGroup8': kibanaPipeline.getXpackCiGroupWorker(8),
42+
'xpack-ciGroup9': kibanaPipeline.getXpackCiGroupWorker(9),
43+
'xpack-ciGroup10': kibanaPipeline.getXpackCiGroupWorker(10),
44+
'xpack-accessibility': kibanaPipeline.getPostBuildWorker('xpack-accessibility', { runbld('./test/scripts/jenkins_xpack_accessibility.sh', 'Execute xpack-accessibility') }),
45+
// 'xpack-visualRegression': kibanaPipeline.getPostBuildWorker('xpack-visualRegression', { runbld('./test/scripts/jenkins_xpack_visual_regression.sh', 'Execute xpack-visualRegression') }),
46+
]),
47+
])
48+
}
4749
}
4850
kibanaPipeline.sendMail()
4951
}

0 commit comments

Comments
 (0)