Skip to content

Commit 1dfd803

Browse files
Merge branch '7.x' into backport/7.x/pr-71237
2 parents 9cd68d2 + d17a80f commit 1dfd803

59 files changed

Lines changed: 1072 additions & 3337 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.

Jenkinsfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ kibanaPipeline(timeoutMinutes: 155, checkPrChanges: true, setCommitStatus: true)
4242
'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10),
4343
'xpack-accessibility': kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh'),
4444
'xpack-savedObjectsFieldMetrics': kibanaPipeline.functionalTestProcess('xpack-savedObjectsFieldMetrics', './test/scripts/jenkins_xpack_saved_objects_field_metrics.sh'),
45-
// 'xpack-pageLoadMetrics': kibanaPipeline.functionalTestProcess('xpack-pageLoadMetrics', './test/scripts/jenkins_xpack_page_load_metrics.sh'),
4645
'xpack-securitySolutionCypress': { processNumber ->
4746
whenChanged(['x-pack/plugins/security_solution/', 'x-pack/test/security_solution_cypress/']) {
4847
kibanaPipeline.functionalTestProcess('xpack-securitySolutionCypress', './test/scripts/jenkins_security_solution_cypress.sh')(processNumber)

docs/api/using-api.asciidoc

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,24 @@ NOTE: The {kib} Console supports only Elasticsearch APIs. You are unable to inte
1010
[float]
1111
[[api-authentication]]
1212
=== Authentication
13-
{kib} supports token-based authentication with the same username and password that you use to log into the {kib} Console.
13+
14+
The {kib} APIs support key- and token-based authentication.
15+
16+
[float]
17+
[[token-api-authentication]]
18+
==== Token-based authentication
19+
20+
To use token-based authentication, you use the same username and password that you use to log into Elastic.
21+
In a given HTTP tool, and when available, you can select to use its 'Basic Authentication' option,
22+
which is where the username and password are stored in order to be passed as part of the call.
23+
24+
[float]
25+
[[key-authentication]]
26+
==== Key-based authentication
27+
28+
To use key-based authentication, you create an API key using the Elastic Console, then specify the key in the header of your API calls.
29+
30+
For information about API keys, refer to <<api-keys,API keys>>.
1431

1532
[float]
1633
[[api-calls]]

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"dashboarding"
1212
],
1313
"private": true,
14-
"version": "7.9.0",
14+
"version": "7.10.0",
1515
"branch": "7.x",
1616
"types": "./kibana.d.ts",
1717
"tsdocMetadata": "./build/tsdoc-metadata.json",
@@ -138,9 +138,9 @@
138138
"@kbn/babel-preset": "1.0.0",
139139
"@kbn/config-schema": "1.0.0",
140140
"@kbn/i18n": "1.0.0",
141-
"@kbn/telemetry-tools": "1.0.0",
142141
"@kbn/interpreter": "1.0.0",
143142
"@kbn/pm": "1.0.0",
143+
"@kbn/telemetry-tools": "1.0.0",
144144
"@kbn/test-subj-selector": "0.2.1",
145145
"@kbn/ui-framework": "1.0.0",
146146
"@kbn/ui-shared-deps": "1.0.0",
@@ -340,6 +340,7 @@
340340
"@types/hapi-auth-cookie": "^9.1.0",
341341
"@types/has-ansi": "^3.0.0",
342342
"@types/history": "^4.7.3",
343+
"@types/hjson": "^2.4.2",
343344
"@types/hoek": "^4.1.3",
344345
"@types/inert": "^5.1.2",
345346
"@types/jest": "^25.2.3",

packages/kbn-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/kbn-optimizer/src/integration_tests/basic_optimization.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ it('prepares assets for distribution', async () => {
220220

221221
expectFileMatchesSnapshotWithCompression('plugins/foo/target/public/foo.plugin.js', 'foo bundle');
222222
expectFileMatchesSnapshotWithCompression(
223-
'plugins/foo/target/public/1.plugin.js',
224-
'1 async bundle'
223+
'plugins/foo/target/public/foo.chunk.1.js',
224+
'foo async bundle'
225225
);
226226
expectFileMatchesSnapshotWithCompression('plugins/bar/target/public/bar.plugin.js', 'bar bundle');
227227
});

packages/kbn-optimizer/src/report_optimizer_stats.ts

Lines changed: 78 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,42 @@
1717
* under the License.
1818
*/
1919

20+
import Fs from 'fs';
21+
import Path from 'path';
22+
2023
import { materialize, mergeMap, dematerialize } from 'rxjs/operators';
2124
import { CiStatsReporter } from '@kbn/dev-utils';
2225

2326
import { OptimizerUpdate$ } from './run_optimizer';
2427
import { OptimizerState, OptimizerConfig } from './optimizer';
2528
import { pipeClosure } from './common';
2629

30+
const flatten = <T>(arr: Array<T | T[]>): T[] =>
31+
arr.reduce((acc: T[], item) => acc.concat(item), []);
32+
33+
interface Entry {
34+
relPath: string;
35+
stats: Fs.Stats;
36+
}
37+
38+
const getFiles = (dir: string, parent?: string) =>
39+
flatten(
40+
Fs.readdirSync(dir).map((name): Entry | Entry[] => {
41+
const absPath = Path.join(dir, name);
42+
const relPath = parent ? Path.join(parent, name) : name;
43+
const stats = Fs.statSync(absPath);
44+
45+
if (stats.isDirectory()) {
46+
return getFiles(absPath, relPath);
47+
}
48+
49+
return {
50+
relPath,
51+
stats,
52+
};
53+
})
54+
);
55+
2756
export function reportOptimizerStats(reporter: CiStatsReporter, config: OptimizerConfig) {
2857
return pipeClosure((update$: OptimizerUpdate$) => {
2958
let lastState: OptimizerState | undefined;
@@ -36,16 +65,55 @@ export function reportOptimizerStats(reporter: CiStatsReporter, config: Optimize
3665

3766
if (n.kind === 'C' && lastState) {
3867
await reporter.metrics(
39-
config.bundles.map((bundle) => {
40-
// make the cache read from the cache file since it was likely updated by the worker
41-
bundle.cache.refresh();
42-
43-
return {
44-
group: `@kbn/optimizer bundle module count`,
45-
id: bundle.id,
46-
value: bundle.cache.getModuleCount() || 0,
47-
};
48-
})
68+
flatten(
69+
config.bundles.map((bundle) => {
70+
// make the cache read from the cache file since it was likely updated by the worker
71+
bundle.cache.refresh();
72+
73+
const outputFiles = getFiles(bundle.outputDir).filter(
74+
(file) => !(file.relPath.startsWith('.') || file.relPath.endsWith('.map'))
75+
);
76+
77+
const entryName = `${bundle.id}.${bundle.type}.js`;
78+
const entry = outputFiles.find((f) => f.relPath === entryName);
79+
if (!entry) {
80+
throw new Error(
81+
`Unable to find bundle entry named [${entryName}] in [${bundle.outputDir}]`
82+
);
83+
}
84+
85+
const chunkPrefix = `${bundle.id}.chunk.`;
86+
const asyncChunks = outputFiles.filter((f) => f.relPath.startsWith(chunkPrefix));
87+
const miscFiles = outputFiles.filter(
88+
(f) => f !== entry && !asyncChunks.includes(f)
89+
);
90+
const sumSize = (files: Entry[]) =>
91+
files.reduce((acc: number, f) => acc + f.stats!.size, 0);
92+
93+
return [
94+
{
95+
group: `@kbn/optimizer bundle module count`,
96+
id: bundle.id,
97+
value: bundle.cache.getModuleCount() || 0,
98+
},
99+
{
100+
group: `page load bundle size`,
101+
id: bundle.id,
102+
value: entry.stats!.size,
103+
},
104+
{
105+
group: `async chunks size`,
106+
id: bundle.id,
107+
value: sumSize(asyncChunks),
108+
},
109+
{
110+
group: `miscellaneous assets size`,
111+
id: bundle.id,
112+
value: sumSize(miscFiles),
113+
},
114+
];
115+
})
116+
)
49117
);
50118
}
51119

packages/kbn-optimizer/src/worker/webpack.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ export function getWebpackConfig(bundle: Bundle, bundleRefs: BundleRefs, worker:
5050

5151
output: {
5252
path: bundle.outputDir,
53-
filename: `[name].${bundle.type}.js`,
53+
filename: `${bundle.id}.${bundle.type}.js`,
54+
chunkFilename: `${bundle.id}.chunk.[id].js`,
5455
devtoolModuleFilenameTemplate: (info) =>
5556
`/${bundle.type}:${bundle.id}/${Path.relative(
5657
bundle.sourceRoot,

packages/kbn-test/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"@types/joi": "^13.4.2",
1717
"@types/lodash": "^4.14.155",
1818
"@types/parse-link-header": "^1.0.0",
19-
"@types/puppeteer": "^3.0.0",
2019
"@types/strip-ansi": "^5.2.1",
2120
"@types/xml2js": "^0.4.5",
2221
"diff": "^4.0.1"
@@ -31,7 +30,6 @@
3130
"joi": "^13.5.2",
3231
"lodash": "^4.17.15",
3332
"parse-link-header": "^1.0.1",
34-
"puppeteer": "^3.3.0",
3533
"rxjs": "^6.5.5",
3634
"strip-ansi": "^5.2.0",
3735
"tar-fs": "^1.16.3",

packages/kbn-test/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,3 @@ export { makeJunitReportPath } from './junit_report_path';
5353
export { CI_PARALLEL_PROCESS_PREFIX } from './ci_parallel_process_prefix';
5454

5555
export * from './functional_test_runner';
56-
export * from './page_load_metrics';

packages/kbn-test/src/page_load_metrics/capture_page_load_metrics.ts

Lines changed: 0 additions & 81 deletions
This file was deleted.

0 commit comments

Comments
 (0)