Skip to content

Commit 094b012

Browse files
Merge branch 'master' into maps/show_icons
2 parents de2487b + bf796b2 commit 094b012

347 files changed

Lines changed: 39030 additions & 4414 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.

.ci/Jenkinsfile_coverage

Lines changed: 16 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -5,89 +5,26 @@ kibanaLibrary.load() // load from the Jenkins instance
55

66
kibanaPipeline(timeoutMinutes: 240) {
77
catchErrors {
8+
def timestamp = new Date(currentBuild.startTimeInMillis).format("yyyy-MM-dd'T'HH:mm:ss'Z'", TimeZone.getTimeZone("UTC"))
89
withEnv([
9-
'CODE_COVERAGE=1', // Needed for multiple ci scripts, such as remote.ts, test/scripts/*.sh, schema.js, etc.
10+
"TIME_STAMP=${timestamp}",
11+
'CODE_COVERAGE=1', // Enables coverage. Needed for multiple ci scripts, such as remote.ts, test/scripts/*.sh, schema.js, etc.
1012
]) {
11-
parallel([
12-
'kibana-intake-agent': workers.intake('kibana-intake', './test/scripts/jenkins_unit.sh'),
13-
'x-pack-intake-agent': {
14-
withEnv([
15-
'NODE_ENV=test' // Needed for jest tests only
16-
]) {
17-
workers.intake('x-pack-intake', './test/scripts/jenkins_xpack.sh')()
18-
}
19-
},
20-
'kibana-oss-agent': workers.functional('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
21-
'oss-ciGroup1': kibanaPipeline.ossCiGroupProcess(1),
22-
'oss-ciGroup2': kibanaPipeline.ossCiGroupProcess(2),
23-
'oss-ciGroup3': kibanaPipeline.ossCiGroupProcess(3),
24-
'oss-ciGroup4': kibanaPipeline.ossCiGroupProcess(4),
25-
'oss-ciGroup5': kibanaPipeline.ossCiGroupProcess(5),
26-
'oss-ciGroup6': kibanaPipeline.ossCiGroupProcess(6),
27-
'oss-ciGroup7': kibanaPipeline.ossCiGroupProcess(7),
28-
'oss-ciGroup8': kibanaPipeline.ossCiGroupProcess(8),
29-
'oss-ciGroup9': kibanaPipeline.ossCiGroupProcess(9),
30-
'oss-ciGroup10': kibanaPipeline.ossCiGroupProcess(10),
31-
'oss-ciGroup11': kibanaPipeline.ossCiGroupProcess(11),
32-
'oss-ciGroup12': kibanaPipeline.ossCiGroupProcess(12),
33-
]),
34-
'kibana-xpack-agent': workers.functional('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
35-
'xpack-ciGroup1': kibanaPipeline.xpackCiGroupProcess(1),
36-
'xpack-ciGroup2': kibanaPipeline.xpackCiGroupProcess(2),
37-
'xpack-ciGroup3': kibanaPipeline.xpackCiGroupProcess(3),
38-
'xpack-ciGroup4': kibanaPipeline.xpackCiGroupProcess(4),
39-
'xpack-ciGroup5': kibanaPipeline.xpackCiGroupProcess(5),
40-
'xpack-ciGroup6': kibanaPipeline.xpackCiGroupProcess(6),
41-
'xpack-ciGroup7': kibanaPipeline.xpackCiGroupProcess(7),
42-
'xpack-ciGroup8': kibanaPipeline.xpackCiGroupProcess(8),
43-
'xpack-ciGroup9': kibanaPipeline.xpackCiGroupProcess(9),
44-
'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10),
45-
]),
46-
])
4713
workers.base(name: 'coverage-worker', size: 'l', ramDisk: false, bootstrapped: false) {
48-
kibanaPipeline.downloadCoverageArtifacts()
49-
kibanaPipeline.bash(
50-
'''
51-
# bootstrap from x-pack folder
52-
source src/dev/ci_setup/setup_env.sh
53-
cd x-pack
54-
yarn kbn bootstrap --prefer-offline
55-
cd ..
56-
# extract archives
57-
mkdir -p /tmp/extracted_coverage
58-
echo extracting intakes
59-
tar -xzf /tmp/downloaded_coverage/coverage/kibana-intake/kibana-coverage.tar.gz -C /tmp/extracted_coverage
60-
tar -xzf /tmp/downloaded_coverage/coverage/x-pack-intake/kibana-coverage.tar.gz -C /tmp/extracted_coverage
61-
echo extracting kibana-oss-tests
62-
tar -xzf /tmp/downloaded_coverage/coverage/kibana-oss-tests/kibana-coverage.tar.gz -C /tmp/extracted_coverage
63-
echo extracting kibana-xpack-tests
64-
tar -xzf /tmp/downloaded_coverage/coverage/kibana-xpack-tests/kibana-coverage.tar.gz -C /tmp/extracted_coverage
65-
# replace path in json files to have valid html report
66-
pwd=$(pwd)
67-
du -sh /tmp/extracted_coverage/target/kibana-coverage/
68-
echo replacing path in json files
69-
for i in {1..9}; do
70-
sed -i "s|/dev/shm/workspace/kibana|$pwd|g" /tmp/extracted_coverage/target/kibana-coverage/functional/${i}*.json &
71-
done
72-
wait
73-
# merge oss & x-pack reports
74-
echo merging coverage reports
75-
yarn nyc report --temp-dir /tmp/extracted_coverage/target/kibana-coverage/jest --report-dir target/kibana-coverage/jest-combined --reporter=html --reporter=json-summary
76-
yarn nyc report --temp-dir /tmp/extracted_coverage/target/kibana-coverage/functional --report-dir target/kibana-coverage/functional-combined --reporter=html --reporter=json-summary
77-
echo copy mocha reports
78-
mkdir -p target/kibana-coverage/mocha-combined
79-
cp -r /tmp/extracted_coverage/target/kibana-coverage/mocha target/kibana-coverage/mocha-combined
80-
''',
81-
"run `yarn kbn bootstrap && merge coverage`"
82-
)
83-
sh 'tar -czf kibana-jest-coverage.tar.gz target/kibana-coverage/jest-combined/*'
84-
kibanaPipeline.uploadCoverageArtifacts("coverage/jest-combined", 'kibana-jest-coverage.tar.gz')
85-
sh 'tar -czf kibana-functional-coverage.tar.gz target/kibana-coverage/functional-combined/*'
86-
kibanaPipeline.uploadCoverageArtifacts("coverage/functional-combined", 'kibana-functional-coverage.tar.gz')
87-
sh 'tar -czf kibana-mocha-coverage.tar.gz target/kibana-coverage/mocha-combined/*'
88-
kibanaPipeline.uploadCoverageArtifacts("coverage/mocha-combined", 'kibana-mocha-coverage.tar.gz')
14+
kibanaCoverage.runTests()
15+
handleIngestion(TIME_STAMP)
8916
}
9017
}
18+
kibanaPipeline.sendMail()
9119
}
92-
kibanaPipeline.sendMail()
9320
}
21+
22+
def handleIngestion(timestamp) {
23+
kibanaPipeline.downloadCoverageArtifacts()
24+
kibanaCoverage.prokLinks("### Process HTML Links")
25+
kibanaCoverage.collectVcsInfo("### Collect VCS Info")
26+
kibanaCoverage.ingest(timestamp, '### Injest && Upload')
27+
kibanaCoverage.uploadCoverageStaticSite(timestamp)
28+
}
29+
30+

.ci/Jenkinsfile_visual_baseline

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,22 @@ library 'kibana-pipeline-library'
44
kibanaLibrary.load()
55

66
kibanaPipeline(timeoutMinutes: 120) {
7-
catchError {
8-
parallel([
9-
'oss-visualRegression': {
10-
workers.ci(name: 'oss-visualRegression', size: 's', ramDisk: false) {
11-
kibanaPipeline.functionalTestProcess('oss-visualRegression', './test/scripts/jenkins_visual_regression.sh')(1)
12-
}
13-
},
14-
'xpack-visualRegression': {
15-
workers.ci(name: 'xpack-visualRegression', size: 's', ramDisk: false) {
16-
kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh')(1)
17-
}
18-
},
19-
])
20-
}
7+
ciStats.trackBuild {
8+
catchError {
9+
parallel([
10+
'oss-visualRegression': {
11+
workers.ci(name: 'oss-visualRegression', size: 's', ramDisk: false) {
12+
kibanaPipeline.functionalTestProcess('oss-visualRegression', './test/scripts/jenkins_visual_regression.sh')(1)
13+
}
14+
},
15+
'xpack-visualRegression': {
16+
workers.ci(name: 'xpack-visualRegression', size: 's', ramDisk: false) {
17+
kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh')(1)
18+
}
19+
},
20+
])
21+
}
2122

22-
kibanaPipeline.sendMail()
23+
kibanaPipeline.sendMail()
24+
}
2325
}

.github/CODEOWNERS

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@
128128
/src/legacy/server/utils/ @elastic/kibana-operations
129129
/src/legacy/server/warnings/ @elastic/kibana-operations
130130

131+
# Quality Assurance
132+
/src/dev/code_coverage @elastic/kibana-qa
133+
131134
# Platform
132135
/src/core/ @elastic/kibana-platform
133136
/config/kibana.yml @elastic/kibana-platform
@@ -161,8 +164,8 @@
161164

162165
# Pulse
163166
/packages/kbn-analytics/ @elastic/pulse
164-
/src/legacy/core_plugins/ui_metric/ @elastic/pulse
165167
/src/plugins/kibana_usage_collection/ @elastic/pulse
168+
/src/plugins/newsfeed/ @elastic/pulse
166169
/src/plugins/telemetry/ @elastic/pulse
167170
/src/plugins/telemetry_collection_manager/ @elastic/pulse
168171
/src/plugins/telemetry_management_section/ @elastic/pulse

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,6 @@ npm-debug.log*
4646
.tern-project
4747
x-pack/plugins/apm/tsconfig.json
4848
apm.tsconfig.json
49+
/x-pack/legacy/plugins/apm/e2e/snapshots.js
4950
/x-pack/plugins/apm/e2e/snapshots.js
51+
.nyc_output

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@
7272
"spec_to_console": "node scripts/spec_to_console",
7373
"backport-skip-ci": "backport --prDescription \"[skip-ci]\"",
7474
"storybook": "node scripts/storybook",
75-
"cover:report": "nyc report --temp-dir target/kibana-coverage/functional --report-dir target/coverage/report --reporter=lcov && open ./target/coverage/report/lcov-report/index.html"
75+
"cover:report": "nyc report --temp-dir target/kibana-coverage/functional --report-dir target/coverage/report --reporter=lcov && open ./target/coverage/report/lcov-report/index.html",
76+
"cover:functional:merge": "nyc report --temp-dir target/kibana-coverage/functional --report-dir target/coverage/report/functional --reporter=json-summary"
7677
},
7778
"repository": {
7879
"type": "git",

packages/kbn-spec-to-console/lib/convert.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,16 @@ module.exports = spec => {
3737
Object.keys(spec).forEach(api => {
3838
const source = spec[api];
3939

40-
if (source.url.paths.every(path => Boolean(path.deprecated))) {
41-
return;
42-
}
43-
4440
if (!source.url) {
4541
return result;
4642
}
43+
44+
if (source.url.path) {
45+
if (source.url.paths.every(path => Boolean(path.deprecated))) {
46+
return;
47+
}
48+
}
49+
4750
const convertedSpec = (result[api] = {});
4851
if (source.params) {
4952
const urlParams = convertParams(source.params);
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@
1717
* under the License.
1818
*/
1919

20-
export const NEWSFEED_FALLBACK_LANGUAGE = 'en';
21-
export const NEWSFEED_LAST_FETCH_STORAGE_KEY = 'newsfeed.lastfetchtime';
22-
export const NEWSFEED_HASH_SET_STORAGE_KEY = 'newsfeed.hashes';
20+
require('../src/setup_node_env');
21+
require('../src/dev/code_coverage/ingest_coverage').runCoverageIngestionCli();

src/core/public/application/application_service.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ export class ApplicationService {
198198
appBasePath: basePath.prepend(app.appRoute!),
199199
mount: wrapMount(plugin, app),
200200
unmountBeforeMounting: false,
201+
legacy: false,
201202
});
202203
},
203204
registerLegacyApp: app => {
@@ -232,6 +233,7 @@ export class ApplicationService {
232233
appBasePath,
233234
mount,
234235
unmountBeforeMounting: true,
236+
legacy: true,
235237
});
236238
},
237239
registerAppUpdater: (appUpdater$: Observable<AppUpdater>) =>

src/core/public/application/integration_tests/router.test.tsx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { createRenderer, createAppMounter, createLegacyAppMounter, getUnmounter
2727
import { AppStatus } from '../types';
2828
import { ScopedHistory } from '../scoped_history';
2929

30-
describe('AppContainer', () => {
30+
describe('AppRouter', () => {
3131
let mounters: MockedMounterMap<EitherApp>;
3232
let globalHistory: History;
3333
let appStatuses$: BehaviorSubject<Map<string, AppStatus>>;
@@ -78,6 +78,16 @@ describe('AppContainer', () => {
7878
history.push('/subpath');
7979
},
8080
}),
81+
createAppMounter({
82+
appId: 'app5',
83+
html: '<div>App 5</div>',
84+
appRoute: '/app/my-app/app5',
85+
}),
86+
createAppMounter({
87+
appId: 'app6',
88+
html: '<div>App 6</div>',
89+
appRoute: '/app/my-app/app6',
90+
}),
8191
] as Array<MockedMounterTuple<EitherApp>>);
8292
globalHistory = createMemoryHistory();
8393
appStatuses$ = mountersToAppStatus$();
@@ -282,6 +292,16 @@ describe('AppContainer', () => {
282292
expect(unmount).not.toHaveBeenCalled();
283293
});
284294

295+
it('allows multiple apps with the same `/app/appXXX` appRoute prefix', async () => {
296+
await navigate('/app/my-app/app5/path');
297+
expect(mounters.get('app5')!.mounter.mount).toHaveBeenCalledTimes(1);
298+
expect(mounters.get('app6')!.mounter.mount).toHaveBeenCalledTimes(0);
299+
300+
await navigate('/app/my-app/app6/another-path');
301+
expect(mounters.get('app5')!.mounter.mount).toHaveBeenCalledTimes(1);
302+
expect(mounters.get('app6')!.mounter.mount).toHaveBeenCalledTimes(1);
303+
});
304+
285305
it('should not remount when when changing pages within app using hash history', async () => {
286306
globalHistory = createHashHistory();
287307
update = createRenderer(

src/core/public/application/integration_tests/utils.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export const createAppMounter = ({
6161
mounter: {
6262
appRoute,
6363
appBasePath: appRoute,
64+
legacy: false,
6465
mount: jest.fn(async (params: AppMountParameters) => {
6566
const { appBasePath: basename, element } = params;
6667
Object.assign(element, {
@@ -88,6 +89,7 @@ export const createLegacyAppMounter = (
8889
appRoute: `/app/${appId.split(':')[0]}`,
8990
appBasePath: `/app/${appId.split(':')[0]}`,
9091
unmountBeforeMounting: true,
92+
legacy: true,
9193
mount: legacyMount,
9294
},
9395
unmount: jest.fn(),

0 commit comments

Comments
 (0)