Skip to content

Commit

Permalink
Merge branch 'main' into reporting/use-chromium-to-print-pdf-part-1
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored May 9, 2022
2 parents a320172 + 1f9047d commit 7d5ac9e
Show file tree
Hide file tree
Showing 244 changed files with 4,016 additions and 1,766 deletions.
8 changes: 5 additions & 3 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,12 @@ enabled:
- x-pack/test/functional/apps/maps/group2/config.ts
- x-pack/test/functional/apps/maps/group3/config.ts
- x-pack/test/functional/apps/maps/group4/config.ts
- x-pack/test/functional/apps/ml/anomaly_detection/config.ts
- x-pack/test/functional/apps/ml/data_frame_analytics/config.ts
- x-pack/test/functional/apps/ml/data_visualizer/config.ts
- x-pack/test/functional/apps/ml/group1/config.ts
- x-pack/test/functional/apps/ml/group2/config.ts
- x-pack/test/functional/apps/ml/group3/config.ts
- x-pack/test/functional/apps/ml/permissions/config.ts
- x-pack/test/functional/apps/ml/short_tests/config.ts
- x-pack/test/functional/apps/ml/stack_management_jobs/config.ts
- x-pack/test/functional/apps/monitoring/config.ts
- x-pack/test/functional/apps/remote_clusters/config.ts
- x-pack/test/functional/apps/reporting_management/config.ts
Expand Down
18 changes: 4 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,10 @@
"@kbn/securitysolution-utils": "link:bazel-bin/packages/kbn-securitysolution-utils",
"@kbn/server-http-tools": "link:bazel-bin/packages/kbn-server-http-tools",
"@kbn/server-route-repository": "link:bazel-bin/packages/kbn-server-route-repository",
"@kbn/shared-ux-avatar-solution": "link:bazel-bin/packages/shared-ux/avatar/solution",
"@kbn/shared-ux-button-exit-full-screen": "link:bazel-bin/packages/shared-ux/button/exit_full_screen",
"@kbn/shared-ux-components": "link:bazel-bin/packages/kbn-shared-ux-components",
"@kbn/shared-ux-link-redirect-app": "link:bazel-bin/packages/shared-ux/link/redirect_app",
"@kbn/shared-ux-services": "link:bazel-bin/packages/kbn-shared-ux-services",
"@kbn/shared-ux-storybook": "link:bazel-bin/packages/kbn-shared-ux-storybook",
"@kbn/shared-ux-utility": "link:bazel-bin/packages/kbn-shared-ux-utility",
Expand Down Expand Up @@ -279,9 +281,7 @@
"https-proxy-agent": "^5.0.0",
"i18n-iso-countries": "^4.3.1",
"icalendar": "0.7.1",
"idx": "^2.5.6",
"immer": "^9.0.6",
"inline-style": "^2.0.0",
"inquirer": "^7.3.3",
"intl": "^1.2.5",
"intl-format-cache": "^2.1.0",
Expand Down Expand Up @@ -416,7 +416,6 @@
"styled-components": "^5.1.0",
"suricata-sid-db": "^1.0.2",
"symbol-observable": "^1.2.0",
"tabbable": "1.1.3",
"tar": "^6.1.11",
"tinycolor2": "1.4.1",
"tinygradient": "0.4.3",
Expand All @@ -439,7 +438,6 @@
"vega-tooltip": "^0.28.0",
"venn.js": "0.2.20",
"vinyl": "^2.2.0",
"vt-pbf": "^3.1.1",
"whatwg-fetch": "^3.0.0",
"xml2js": "^0.4.22",
"yauzl": "^2.10.0"
Expand Down Expand Up @@ -670,8 +668,10 @@
"@types/kbn__securitysolution-utils": "link:bazel-bin/packages/kbn-securitysolution-utils/npm_module_types",
"@types/kbn__server-http-tools": "link:bazel-bin/packages/kbn-server-http-tools/npm_module_types",
"@types/kbn__server-route-repository": "link:bazel-bin/packages/kbn-server-route-repository/npm_module_types",
"@types/kbn__shared-ux-avatar-solution": "link:bazel-bin/packages/shared-ux/avatar/solution/npm_module_types",
"@types/kbn__shared-ux-button-exit-full-screen": "link:bazel-bin/packages/shared-ux/button/exit_full_screen/npm_module_types",
"@types/kbn__shared-ux-components": "link:bazel-bin/packages/kbn-shared-ux-components/npm_module_types",
"@types/kbn__shared-ux-link-redirect-app": "link:bazel-bin/packages/shared-ux/link/redirect_app/npm_module_types",
"@types/kbn__shared-ux-services": "link:bazel-bin/packages/kbn-shared-ux-services/npm_module_types",
"@types/kbn__shared-ux-storybook": "link:bazel-bin/packages/kbn-shared-ux-storybook/npm_module_types",
"@types/kbn__shared-ux-utility": "link:bazel-bin/packages/kbn-shared-ux-utility/npm_module_types",
Expand Down Expand Up @@ -716,7 +716,6 @@
"@types/opn": "^5.1.0",
"@types/ora": "^1.3.5",
"@types/papaparse": "^5.0.3",
"@types/parse-link-header": "^1.0.0",
"@types/pbf": "3.0.2",
"@types/pdfmake": "^0.1.19",
"@types/pegjs": "^0.10.1",
Expand Down Expand Up @@ -758,7 +757,6 @@
"@types/supertest": "^2.0.5",
"@types/tapable": "^1.0.6",
"@types/tar": "^4.0.5",
"@types/tar-fs": "^1.16.1",
"@types/tempy": "^0.2.0",
"@types/testing-library__jest-dom": "^5.14.3",
"@types/tinycolor2": "^1.4.1",
Expand Down Expand Up @@ -855,7 +853,6 @@
"file-loader": "^4.2.0",
"form-data": "^4.0.0",
"geckodriver": "^3.0.1",
"glob-watcher": "5.0.3",
"gulp": "4.0.2",
"gulp-babel": "^8.0.0",
"gulp-brotli": "^3.0.0",
Expand Down Expand Up @@ -895,13 +892,11 @@
"marge": "^1.0.1",
"micromatch": "3.1.10",
"minimist": "^1.2.6",
"mkdirp": "0.5.1",
"mocha": "^9.1.0",
"mocha-junit-reporter": "^2.0.2",
"mochawesome": "^7.0.1",
"mochawesome-merge": "^4.2.1",
"mock-fs": "^5.1.2",
"mock-http-server": "1.3.0",
"ms-chromium-edge-driver": "^0.5.1",
"multimatch": "^4.0.0",
"mutation-observer": "^1.0.3",
Expand All @@ -911,10 +906,8 @@
"nyc": "^15.1.0",
"oboe": "^2.1.4",
"openapi-types": "^10.0.0",
"parse-link-header": "^1.0.1",
"pbf": "3.2.1",
"pirates": "^4.0.1",
"pixelmatch": "^5.1.0",
"playwright": "^1.17.1",
"postcss": "^7.0.32",
"postcss-loader": "^3.0.0",
Expand All @@ -928,9 +921,7 @@
"resolve": "^1.22.0",
"rxjs-marbles": "^5.0.6",
"sass-loader": "^10.2.0",
"sass-resources-loader": "^2.0.1",
"selenium-webdriver": "^4.1.1",
"serve-static": "1.14.1",
"shelljs": "^0.8.4",
"simple-git": "1.116.0",
"sinon": "^7.4.2",
Expand All @@ -946,7 +937,6 @@
"supertest": "^3.1.0",
"supports-color": "^7.0.0",
"tape": "^5.0.1",
"tar-fs": "^2.1.0",
"tempy": "^0.3.0",
"terser": "^5.7.1",
"terser-webpack-plugin": "^4.2.3",
Expand Down
4 changes: 4 additions & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ filegroup(
"//packages/kbn-ui-theme:build",
"//packages/kbn-utility-types:build",
"//packages/kbn-utils:build",
"//packages/shared-ux/avatar/solution:build",
"//packages/shared-ux/button/exit_full_screen:build",
"//packages/shared-ux/link/redirect_app:build",
],
)

Expand Down Expand Up @@ -202,7 +204,9 @@ filegroup(
"//packages/kbn-ui-theme:build_types",
"//packages/kbn-utility-types:build_types",
"//packages/kbn-utils:build_types",
"//packages/shared-ux/avatar/solution:build_types",
"//packages/shared-ux/button/exit_full_screen:build_types",
"//packages/shared-ux/link/redirect_app:build_types",
],
)

Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-dev-utils/src/proc_runner/proc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,5 +156,8 @@ export function startProc(name: string, options: ProcOptions, log: ToolingLog) {
outcome$,
outcomePromise,
stop,
stopWasCalled() {
return stopCalled;
},
};
}
31 changes: 21 additions & 10 deletions packages/kbn-dev-utils/src/proc_runner/proc_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const noop = () => {};
interface RunOptions extends ProcOptions {
wait: true | RegExp;
waitTimeout?: number | false;
onEarlyExit?: (msg: string) => void;
}

/**
Expand All @@ -47,16 +48,6 @@ export class ProcRunner {

/**
* Start a process, tracking it by `name`
* @param {String} name
* @param {Object} options
* @property {String} options.cmd executable to run
* @property {Array<String>?} options.args arguments to provide the executable
* @property {String?} options.cwd current working directory for the process
* @property {RegExp|Boolean} options.wait Should start() wait for some time? Use
* `true` will wait until the proc exits,
* a `RegExp` will wait until that log line
* is found
* @return {Promise<undefined>}
*/
async run(name: string, options: RunOptions) {
const {
Expand All @@ -66,6 +57,7 @@ export class ProcRunner {
wait = false,
waitTimeout = 15 * MINUTE,
env = process.env,
onEarlyExit,
} = options;
const cmd = options.cmd === 'node' ? process.execPath : options.cmd;

Expand All @@ -89,6 +81,25 @@ export class ProcRunner {
stdin,
});

if (onEarlyExit) {
proc.outcomePromise
.then(
(code) => {
if (!proc.stopWasCalled()) {
onEarlyExit(`[${name}] exitted early with ${code}`);
}
},
(error) => {
if (!proc.stopWasCalled()) {
onEarlyExit(`[${name}] exitted early: ${error.message}`);
}
}
)
.catch((error) => {
throw new Error(`Error handling early exit: ${error.stack}`);
});
}

try {
if (wait instanceof RegExp) {
// wait for process to log matching line
Expand Down
19 changes: 19 additions & 0 deletions packages/kbn-es/src/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,25 @@ exports.Cluster = class Cluster {
}),
]);
});

if (options.onEarlyExit) {
this._outcome
.then(
() => {
if (!this._stopCalled) {
options.onEarlyExit(`ES exitted unexpectedly`);
}
},
(error) => {
if (!this._stopCalled) {
options.onEarlyExit(`ES exitted unexpectedly: ${error.stack}`);
}
}
)
.catch((error) => {
throw new Error(`failure handling early exit: ${error.stack}`);
});
}
}

/**
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-es/src/cluster_exec_options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ export interface EsClusterExecOptions {
password?: string;
skipReadyCheck?: boolean;
readyTimeout?: number;
onEarlyExit?: (msg: string) => void;
}
Loading

0 comments on commit 7d5ac9e

Please sign in to comment.