mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* fix(NA): use a single step for yarn kbn bootstrap
* chore(NA): additional error message to warn around new integration
* chore(NA): additional error message to warn around new integration
(cherry picked from commit 7f4735f4d3
)
# Conflicts:
# packages/kbn-pm/dist/index.js
This commit is contained in:
parent
0b6f6d93ea
commit
8af104784c
5 changed files with 10 additions and 47 deletions
|
@ -15,7 +15,7 @@ if ! yarn kbn bootstrap; then
|
||||||
rm -rf node_modules
|
rm -rf node_modules
|
||||||
|
|
||||||
echo "--- yarn install and bootstrap, attempt 2"
|
echo "--- yarn install and bootstrap, attempt 2"
|
||||||
yarn kbn bootstrap
|
yarn kbn bootstrap --force-install
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$DISABLE_BOOTSTRAP_VALIDATION" != "true" ]]; then
|
if [[ "$DISABLE_BOOTSTRAP_VALIDATION" != "true" ]]; then
|
||||||
|
|
22
packages/kbn-pm/dist/index.js
vendored
22
packages/kbn-pm/dist/index.js
vendored
|
@ -8910,10 +8910,9 @@ const BootstrapCommand = {
|
||||||
const kibanaProjectPath = ((_projects$get = projects.get('kibana')) === null || _projects$get === void 0 ? void 0 : _projects$get.path) || '';
|
const kibanaProjectPath = ((_projects$get = projects.get('kibana')) === null || _projects$get === void 0 ? void 0 : _projects$get.path) || '';
|
||||||
const runOffline = (options === null || options === void 0 ? void 0 : options.offline) === true;
|
const runOffline = (options === null || options === void 0 ? void 0 : options.offline) === true;
|
||||||
const reporter = _kbn_dev_utils_ci_stats_reporter__WEBPACK_IMPORTED_MODULE_1__["CiStatsReporter"].fromEnv(_utils_log__WEBPACK_IMPORTED_MODULE_2__["log"]);
|
const reporter = _kbn_dev_utils_ci_stats_reporter__WEBPACK_IMPORTED_MODULE_1__["CiStatsReporter"].fromEnv(_utils_log__WEBPACK_IMPORTED_MODULE_2__["log"]);
|
||||||
const timings = []; // Force install is set in case a flag is passed into yarn kbn bootstrap or if the `.yarn-integrity`
|
const timings = []; // Force install is set in case a flag is passed into yarn kbn bootstrap
|
||||||
// file is not found which will be indicated by the return of yarnIntegrityFileExists.
|
|
||||||
|
|
||||||
const forceInstall = !!options && options['force-install'] === true || !(await Object(_utils_bazel__WEBPACK_IMPORTED_MODULE_9__["yarnIntegrityFileExists"])(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(kibanaProjectPath, 'node_modules'))); // Install bazel machinery tools if needed
|
const forceInstall = !!options && options['force-install'] === true; // Install bazel machinery tools if needed
|
||||||
|
|
||||||
await Object(_utils_bazel__WEBPACK_IMPORTED_MODULE_9__["installBazelTools"])(rootPath); // Setup remote cache settings in .bazelrc.cache if needed
|
await Object(_utils_bazel__WEBPACK_IMPORTED_MODULE_9__["installBazelTools"])(rootPath); // Setup remote cache settings in .bazelrc.cache if needed
|
||||||
|
|
||||||
|
@ -52575,8 +52574,6 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
/* harmony import */ var _yarn_integrity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(526);
|
/* harmony import */ var _yarn_integrity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(526);
|
||||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeYarnIntegrityFileIfExists", function() { return _yarn_integrity__WEBPACK_IMPORTED_MODULE_3__["removeYarnIntegrityFileIfExists"]; });
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeYarnIntegrityFileIfExists", function() { return _yarn_integrity__WEBPACK_IMPORTED_MODULE_3__["removeYarnIntegrityFileIfExists"]; });
|
||||||
|
|
||||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "yarnIntegrityFileExists", function() { return _yarn_integrity__WEBPACK_IMPORTED_MODULE_3__["yarnIntegrityFileExists"]; });
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||||
* or more contributor license agreements. Licensed under the Elastic License
|
* or more contributor license agreements. Licensed under the Elastic License
|
||||||
|
@ -52802,6 +52799,7 @@ async function runBazelCommandWithRunner(bazelCommandRunner, bazelArgs, offline
|
||||||
try {
|
try {
|
||||||
await bazelProc;
|
await bazelProc;
|
||||||
} catch {
|
} catch {
|
||||||
|
_log__WEBPACK_IMPORTED_MODULE_5__["log"].error('HINT: If experiencing problems with node_modules try `yarn kbn bootstrap --force-install` or as last resort `yarn kbn reset && yarn kbn bootstrap`');
|
||||||
throw new _errors__WEBPACK_IMPORTED_MODULE_6__["CliError"](`The bazel command that was running failed to complete.`);
|
throw new _errors__WEBPACK_IMPORTED_MODULE_6__["CliError"](`The bazel command that was running failed to complete.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59009,7 +59007,6 @@ function observeReadable(readable) {
|
||||||
"use strict";
|
"use strict";
|
||||||
__webpack_require__.r(__webpack_exports__);
|
__webpack_require__.r(__webpack_exports__);
|
||||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeYarnIntegrityFileIfExists", function() { return removeYarnIntegrityFileIfExists; });
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeYarnIntegrityFileIfExists", function() { return removeYarnIntegrityFileIfExists; });
|
||||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "yarnIntegrityFileExists", function() { return yarnIntegrityFileExists; });
|
|
||||||
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
|
||||||
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
|
||||||
/* harmony import */ var _fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(231);
|
/* harmony import */ var _fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(231);
|
||||||
|
@ -59033,19 +59030,6 @@ async function removeYarnIntegrityFileIfExists(nodeModulesPath) {
|
||||||
} catch {// no-op
|
} catch {// no-op
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function yarnIntegrityFileExists(nodeModulesPath) {
|
|
||||||
try {
|
|
||||||
const nodeModulesRealPath = await Object(_fs__WEBPACK_IMPORTED_MODULE_1__["tryRealpath"])(nodeModulesPath);
|
|
||||||
const yarnIntegrityFilePath = Object(path__WEBPACK_IMPORTED_MODULE_0__["join"])(nodeModulesRealPath, '.yarn-integrity'); // check if the file already exists
|
|
||||||
|
|
||||||
if (await Object(_fs__WEBPACK_IMPORTED_MODULE_1__["isFile"])(yarnIntegrityFilePath)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} catch {// no-op
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
/* 527 */
|
/* 527 */
|
||||||
|
|
|
@ -17,12 +17,7 @@ import { ICommand } from './';
|
||||||
import { readYarnLock } from '../utils/yarn_lock';
|
import { readYarnLock } from '../utils/yarn_lock';
|
||||||
import { sortPackageJson } from '../utils/sort_package_json';
|
import { sortPackageJson } from '../utils/sort_package_json';
|
||||||
import { validateDependencies } from '../utils/validate_dependencies';
|
import { validateDependencies } from '../utils/validate_dependencies';
|
||||||
import {
|
import { installBazelTools, removeYarnIntegrityFileIfExists, runBazel } from '../utils/bazel';
|
||||||
installBazelTools,
|
|
||||||
removeYarnIntegrityFileIfExists,
|
|
||||||
runBazel,
|
|
||||||
yarnIntegrityFileExists,
|
|
||||||
} from '../utils/bazel';
|
|
||||||
import { setupRemoteCache } from '../utils/bazel/setup_remote_cache';
|
import { setupRemoteCache } from '../utils/bazel/setup_remote_cache';
|
||||||
|
|
||||||
export const BootstrapCommand: ICommand = {
|
export const BootstrapCommand: ICommand = {
|
||||||
|
@ -42,11 +37,8 @@ export const BootstrapCommand: ICommand = {
|
||||||
const reporter = CiStatsReporter.fromEnv(log);
|
const reporter = CiStatsReporter.fromEnv(log);
|
||||||
const timings = [];
|
const timings = [];
|
||||||
|
|
||||||
// Force install is set in case a flag is passed into yarn kbn bootstrap or if the `.yarn-integrity`
|
// Force install is set in case a flag is passed into yarn kbn bootstrap
|
||||||
// file is not found which will be indicated by the return of yarnIntegrityFileExists.
|
const forceInstall = !!options && options['force-install'] === true;
|
||||||
const forceInstall =
|
|
||||||
(!!options && options['force-install'] === true) ||
|
|
||||||
!(await yarnIntegrityFileExists(resolve(kibanaProjectPath, 'node_modules')));
|
|
||||||
|
|
||||||
// Install bazel machinery tools if needed
|
// Install bazel machinery tools if needed
|
||||||
await installBazelTools(rootPath);
|
await installBazelTools(rootPath);
|
||||||
|
|
|
@ -52,6 +52,9 @@ async function runBazelCommandWithRunner(
|
||||||
try {
|
try {
|
||||||
await bazelProc;
|
await bazelProc;
|
||||||
} catch {
|
} catch {
|
||||||
|
log.error(
|
||||||
|
'HINT: If experiencing problems with node_modules try `yarn kbn bootstrap --force-install` or as last resort `yarn kbn reset && yarn kbn bootstrap`'
|
||||||
|
);
|
||||||
throw new CliError(`The bazel command that was running failed to complete.`);
|
throw new CliError(`The bazel command that was running failed to complete.`);
|
||||||
}
|
}
|
||||||
await bazelLogs$.toPromise();
|
await bazelLogs$.toPromise();
|
||||||
|
|
|
@ -22,19 +22,3 @@ export async function removeYarnIntegrityFileIfExists(nodeModulesPath: string) {
|
||||||
// no-op
|
// no-op
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function yarnIntegrityFileExists(nodeModulesPath: string) {
|
|
||||||
try {
|
|
||||||
const nodeModulesRealPath = await tryRealpath(nodeModulesPath);
|
|
||||||
const yarnIntegrityFilePath = join(nodeModulesRealPath, '.yarn-integrity');
|
|
||||||
|
|
||||||
// check if the file already exists
|
|
||||||
if (await isFile(yarnIntegrityFilePath)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
// no-op
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue