Conversation
This reverts commit 150df38.
|
Pinging @elastic/kibana-operations (Team:Operations) |
|
|
||
| const stack: string[] = [rootNodeModulesDir]; | ||
|
|
||
| while (stack.length > 0) { |
There was a problem hiding this comment.
Not a requirement since this is quick enough, but it would make this more concise so I'll leave it up to you.
fast-glob can be useful here to find all the package.json files. For #245334 I was using:
const pkgJsonFiles = await fg('node_modules/{*,@*/*}/package.json', { cwd: repoRoot });This will only match:
node_modules/<package>/package.json
node_modules/@<scope>/<package>/package.json
Since you're handling nested as well, the pattern would be node_modules/**/package.json.
There was a problem hiding this comment.
I like the idea if simplifying. I gave fast-glob a try but it ended up pulling in test files like tape/node_modules/resolve/test/resolver/multirepo/package.json, and filtering those out ended up bringing the complexity back up unfortunately.
I'll leave it as is for now, but not opposed to cleanup in the future
azasypkin
left a comment
There was a problem hiding this comment.
LGTM, thanks for doing this!
💚 Build Succeeded
Metrics [docs]
History
|
|
Starting backport for target branches: 8.19, 9.1, 9.2, 9.3 https://github.com/elastic/kibana/actions/runs/21457488145 |
Disables `yarn install` lifecycle scripts and adds a config file to
specify which scripts run.
Adds:
- `ignore-scripts true` to `.yarnrc`
- `@kbn/yarn-install-scripts` CLI with:
- `run`: runs allowed install scripts defined in
`packages/kbn-yarn-install-scripts/config.json`
- `scan`: lists packages with install scripts
- Integration into `yarn kbn bootstrap`
- CI check that fails if a new or updated package has an install script
not defined in `config.json`
Usage:
```
$ yarn kbn bootstrap
...
success yarn dependencies installed
success Playwright browsers installed
info running allowlisted install scripts
info Running 4 install script(s)...
info Running install for chromedriver@143.0.4
info Running postinstall for cypress@13.17.0
info Running postinstall for esbuild@0.25.9
info Running postinstall for geckodriver@6.1.0
succ Install scripts complete
success install scripts completed
$ node scripts/yarn_install_scripts run --dry-run
info Running 4 install script(s)...
info [dry-run] Would run install for chromedriver@143.0.1
info [dry-run] Would run postinstall for cypress@13.17.0
info [dry-run] Would run postinstall for esbuild@0.25.9
info [dry-run] Would run postinstall for geckodriver@6.1.0
succ Install scripts complete
$ node scripts/yarn_install_scripts scan
info ┌─────────────────────────┬──────────┬─────────┬─────────────┬─────────────────────────────────┐
│ Package │ Status │ Version │ Lifecycle │ Script │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ chromedriver │ required │ 143.0.1 │ install │ node install.js │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ cypress │ required │ 13.17.0 │ postinstall │ node index.js --exec install │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ esbuild │ required │ 0.25.9 │ postinstall │ node install.js │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ ... │ ... │ ... │ ... │ ... │
└─────────────────────────┴──────────┴─────────┴─────────────┴─────────────────────────────────┘
succ Found 18 install scripts: 4 required, 14 skipped, 0 unconfigured
```
Part of elastic#128025
(cherry picked from commit d3e316f)
Disables `yarn install` lifecycle scripts and adds a config file to
specify which scripts run.
Adds:
- `ignore-scripts true` to `.yarnrc`
- `@kbn/yarn-install-scripts` CLI with:
- `run`: runs allowed install scripts defined in
`packages/kbn-yarn-install-scripts/config.json`
- `scan`: lists packages with install scripts
- Integration into `yarn kbn bootstrap`
- CI check that fails if a new or updated package has an install script
not defined in `config.json`
Usage:
```
$ yarn kbn bootstrap
...
success yarn dependencies installed
success Playwright browsers installed
info running allowlisted install scripts
info Running 4 install script(s)...
info Running install for chromedriver@143.0.4
info Running postinstall for cypress@13.17.0
info Running postinstall for esbuild@0.25.9
info Running postinstall for geckodriver@6.1.0
succ Install scripts complete
success install scripts completed
$ node scripts/yarn_install_scripts run --dry-run
info Running 4 install script(s)...
info [dry-run] Would run install for chromedriver@143.0.1
info [dry-run] Would run postinstall for cypress@13.17.0
info [dry-run] Would run postinstall for esbuild@0.25.9
info [dry-run] Would run postinstall for geckodriver@6.1.0
succ Install scripts complete
$ node scripts/yarn_install_scripts scan
info ┌─────────────────────────┬──────────┬─────────┬─────────────┬─────────────────────────────────┐
│ Package │ Status │ Version │ Lifecycle │ Script │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ chromedriver │ required │ 143.0.1 │ install │ node install.js │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ cypress │ required │ 13.17.0 │ postinstall │ node index.js --exec install │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ esbuild │ required │ 0.25.9 │ postinstall │ node install.js │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ ... │ ... │ ... │ ... │ ... │
└─────────────────────────┴──────────┴─────────┴─────────────┴─────────────────────────────────┘
succ Found 18 install scripts: 4 required, 14 skipped, 0 unconfigured
```
Part of elastic#128025
(cherry picked from commit d3e316f)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `9.3`: - [Manage yarn install scripts (#250638)](#250638) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Jon","email":"jon@elastic.co"},"sourceCommit":{"committedDate":"2026-01-28T22:13:49Z","message":"Manage yarn install scripts (#250638)\n\nDisables `yarn install` lifecycle scripts and adds a config file to\nspecify which scripts run.\n\nAdds:\n- `ignore-scripts true` to `.yarnrc`\n- `@kbn/yarn-install-scripts` CLI with:\n- `run`: runs allowed install scripts defined in\n`packages/kbn-yarn-install-scripts/config.json`\n - `scan`: lists packages with install scripts\n- Integration into `yarn kbn bootstrap`\n- CI check that fails if a new or updated package has an install script\nnot defined in `config.json`\n\nUsage:\n```\n$ yarn kbn bootstrap\n...\nsuccess yarn dependencies installed\nsuccess Playwright browsers installed\ninfo running allowlisted install scripts\n info Running 4 install script(s)...\n info Running install for chromedriver@143.0.4\n info Running postinstall for cypress@13.17.0\n info Running postinstall for esbuild@0.25.9\n info Running postinstall for geckodriver@6.1.0\n succ Install scripts complete\nsuccess install scripts completed\n\n$ node scripts/yarn_install_scripts run --dry-run\n info Running 4 install script(s)...\n info [dry-run] Would run install for chromedriver@143.0.1\n info [dry-run] Would run postinstall for cypress@13.17.0\n info [dry-run] Would run postinstall for esbuild@0.25.9\n info [dry-run] Would run postinstall for geckodriver@6.1.0\n succ Install scripts complete\n\n$ node scripts/yarn_install_scripts scan\n info ┌─────────────────────────┬──────────┬─────────┬─────────────┬─────────────────────────────────┐\n │ Package │ Status │ Version │ Lifecycle │ Script │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ chromedriver │ required │ 143.0.1 │ install │ node install.js │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ cypress │ required │ 13.17.0 │ postinstall │ node index.js --exec install │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ esbuild │ required │ 0.25.9 │ postinstall │ node install.js │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ ... │ ... │ ... │ ... │ ... │\n └─────────────────────────┴──────────┴─────────┴─────────────┴─────────────────────────────────┘\n succ Found 18 install scripts: 4 required, 14 skipped, 0 unconfigured\n```\nPart of https://github.com/elastic/kibana/issues/128025","sha":"d3e316fb87d7ced84abe0da160d08b249eb9d40b","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Operations","release_note:skip","backport:all-open","v9.4.0"],"title":"Manage yarn install scripts","number":250638,"url":"https://github.com/elastic/kibana/pull/250638","mergeCommit":{"message":"Manage yarn install scripts (#250638)\n\nDisables `yarn install` lifecycle scripts and adds a config file to\nspecify which scripts run.\n\nAdds:\n- `ignore-scripts true` to `.yarnrc`\n- `@kbn/yarn-install-scripts` CLI with:\n- `run`: runs allowed install scripts defined in\n`packages/kbn-yarn-install-scripts/config.json`\n - `scan`: lists packages with install scripts\n- Integration into `yarn kbn bootstrap`\n- CI check that fails if a new or updated package has an install script\nnot defined in `config.json`\n\nUsage:\n```\n$ yarn kbn bootstrap\n...\nsuccess yarn dependencies installed\nsuccess Playwright browsers installed\ninfo running allowlisted install scripts\n info Running 4 install script(s)...\n info Running install for chromedriver@143.0.4\n info Running postinstall for cypress@13.17.0\n info Running postinstall for esbuild@0.25.9\n info Running postinstall for geckodriver@6.1.0\n succ Install scripts complete\nsuccess install scripts completed\n\n$ node scripts/yarn_install_scripts run --dry-run\n info Running 4 install script(s)...\n info [dry-run] Would run install for chromedriver@143.0.1\n info [dry-run] Would run postinstall for cypress@13.17.0\n info [dry-run] Would run postinstall for esbuild@0.25.9\n info [dry-run] Would run postinstall for geckodriver@6.1.0\n succ Install scripts complete\n\n$ node scripts/yarn_install_scripts scan\n info ┌─────────────────────────┬──────────┬─────────┬─────────────┬─────────────────────────────────┐\n │ Package │ Status │ Version │ Lifecycle │ Script │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ chromedriver │ required │ 143.0.1 │ install │ node install.js │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ cypress │ required │ 13.17.0 │ postinstall │ node index.js --exec install │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ esbuild │ required │ 0.25.9 │ postinstall │ node install.js │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ ... │ ... │ ... │ ... │ ... │\n └─────────────────────────┴──────────┴─────────┴─────────────┴─────────────────────────────────┘\n succ Found 18 install scripts: 4 required, 14 skipped, 0 unconfigured\n```\nPart of https://github.com/elastic/kibana/issues/128025","sha":"d3e316fb87d7ced84abe0da160d08b249eb9d40b"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/250638","number":250638,"mergeCommit":{"message":"Manage yarn install scripts (#250638)\n\nDisables `yarn install` lifecycle scripts and adds a config file to\nspecify which scripts run.\n\nAdds:\n- `ignore-scripts true` to `.yarnrc`\n- `@kbn/yarn-install-scripts` CLI with:\n- `run`: runs allowed install scripts defined in\n`packages/kbn-yarn-install-scripts/config.json`\n - `scan`: lists packages with install scripts\n- Integration into `yarn kbn bootstrap`\n- CI check that fails if a new or updated package has an install script\nnot defined in `config.json`\n\nUsage:\n```\n$ yarn kbn bootstrap\n...\nsuccess yarn dependencies installed\nsuccess Playwright browsers installed\ninfo running allowlisted install scripts\n info Running 4 install script(s)...\n info Running install for chromedriver@143.0.4\n info Running postinstall for cypress@13.17.0\n info Running postinstall for esbuild@0.25.9\n info Running postinstall for geckodriver@6.1.0\n succ Install scripts complete\nsuccess install scripts completed\n\n$ node scripts/yarn_install_scripts run --dry-run\n info Running 4 install script(s)...\n info [dry-run] Would run install for chromedriver@143.0.1\n info [dry-run] Would run postinstall for cypress@13.17.0\n info [dry-run] Would run postinstall for esbuild@0.25.9\n info [dry-run] Would run postinstall for geckodriver@6.1.0\n succ Install scripts complete\n\n$ node scripts/yarn_install_scripts scan\n info ┌─────────────────────────┬──────────┬─────────┬─────────────┬─────────────────────────────────┐\n │ Package │ Status │ Version │ Lifecycle │ Script │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ chromedriver │ required │ 143.0.1 │ install │ node install.js │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ cypress │ required │ 13.17.0 │ postinstall │ node index.js --exec install │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ esbuild │ required │ 0.25.9 │ postinstall │ node install.js │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ ... │ ... │ ... │ ... │ ... │\n └─────────────────────────┴──────────┴─────────┴─────────────┴─────────────────────────────────┘\n succ Found 18 install scripts: 4 required, 14 skipped, 0 unconfigured\n```\nPart of https://github.com/elastic/kibana/issues/128025","sha":"d3e316fb87d7ced84abe0da160d08b249eb9d40b"}}]}] BACKPORT--> Co-authored-by: Jon <jon@elastic.co>
# Backport This will backport the following commits from `main` to `9.2`: - [Manage yarn install scripts (#250638)](#250638) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Jon","email":"jon@elastic.co"},"sourceCommit":{"committedDate":"2026-01-28T22:13:49Z","message":"Manage yarn install scripts (#250638)\n\nDisables `yarn install` lifecycle scripts and adds a config file to\nspecify which scripts run.\n\nAdds:\n- `ignore-scripts true` to `.yarnrc`\n- `@kbn/yarn-install-scripts` CLI with:\n- `run`: runs allowed install scripts defined in\n`packages/kbn-yarn-install-scripts/config.json`\n - `scan`: lists packages with install scripts\n- Integration into `yarn kbn bootstrap`\n- CI check that fails if a new or updated package has an install script\nnot defined in `config.json`\n\nUsage:\n```\n$ yarn kbn bootstrap\n...\nsuccess yarn dependencies installed\nsuccess Playwright browsers installed\ninfo running allowlisted install scripts\n info Running 4 install script(s)...\n info Running install for chromedriver@143.0.4\n info Running postinstall for cypress@13.17.0\n info Running postinstall for esbuild@0.25.9\n info Running postinstall for geckodriver@6.1.0\n succ Install scripts complete\nsuccess install scripts completed\n\n$ node scripts/yarn_install_scripts run --dry-run\n info Running 4 install script(s)...\n info [dry-run] Would run install for chromedriver@143.0.1\n info [dry-run] Would run postinstall for cypress@13.17.0\n info [dry-run] Would run postinstall for esbuild@0.25.9\n info [dry-run] Would run postinstall for geckodriver@6.1.0\n succ Install scripts complete\n\n$ node scripts/yarn_install_scripts scan\n info ┌─────────────────────────┬──────────┬─────────┬─────────────┬─────────────────────────────────┐\n │ Package │ Status │ Version │ Lifecycle │ Script │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ chromedriver │ required │ 143.0.1 │ install │ node install.js │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ cypress │ required │ 13.17.0 │ postinstall │ node index.js --exec install │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ esbuild │ required │ 0.25.9 │ postinstall │ node install.js │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ ... │ ... │ ... │ ... │ ... │\n └─────────────────────────┴──────────┴─────────┴─────────────┴─────────────────────────────────┘\n succ Found 18 install scripts: 4 required, 14 skipped, 0 unconfigured\n```\nPart of https://github.com/elastic/kibana/issues/128025","sha":"d3e316fb87d7ced84abe0da160d08b249eb9d40b","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Operations","release_note:skip","backport:all-open","v9.4.0"],"title":"Manage yarn install scripts","number":250638,"url":"https://github.com/elastic/kibana/pull/250638","mergeCommit":{"message":"Manage yarn install scripts (#250638)\n\nDisables `yarn install` lifecycle scripts and adds a config file to\nspecify which scripts run.\n\nAdds:\n- `ignore-scripts true` to `.yarnrc`\n- `@kbn/yarn-install-scripts` CLI with:\n- `run`: runs allowed install scripts defined in\n`packages/kbn-yarn-install-scripts/config.json`\n - `scan`: lists packages with install scripts\n- Integration into `yarn kbn bootstrap`\n- CI check that fails if a new or updated package has an install script\nnot defined in `config.json`\n\nUsage:\n```\n$ yarn kbn bootstrap\n...\nsuccess yarn dependencies installed\nsuccess Playwright browsers installed\ninfo running allowlisted install scripts\n info Running 4 install script(s)...\n info Running install for chromedriver@143.0.4\n info Running postinstall for cypress@13.17.0\n info Running postinstall for esbuild@0.25.9\n info Running postinstall for geckodriver@6.1.0\n succ Install scripts complete\nsuccess install scripts completed\n\n$ node scripts/yarn_install_scripts run --dry-run\n info Running 4 install script(s)...\n info [dry-run] Would run install for chromedriver@143.0.1\n info [dry-run] Would run postinstall for cypress@13.17.0\n info [dry-run] Would run postinstall for esbuild@0.25.9\n info [dry-run] Would run postinstall for geckodriver@6.1.0\n succ Install scripts complete\n\n$ node scripts/yarn_install_scripts scan\n info ┌─────────────────────────┬──────────┬─────────┬─────────────┬─────────────────────────────────┐\n │ Package │ Status │ Version │ Lifecycle │ Script │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ chromedriver │ required │ 143.0.1 │ install │ node install.js │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ cypress │ required │ 13.17.0 │ postinstall │ node index.js --exec install │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ esbuild │ required │ 0.25.9 │ postinstall │ node install.js │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ ... │ ... │ ... │ ... │ ... │\n └─────────────────────────┴──────────┴─────────┴─────────────┴─────────────────────────────────┘\n succ Found 18 install scripts: 4 required, 14 skipped, 0 unconfigured\n```\nPart of https://github.com/elastic/kibana/issues/128025","sha":"d3e316fb87d7ced84abe0da160d08b249eb9d40b"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/250638","number":250638,"mergeCommit":{"message":"Manage yarn install scripts (#250638)\n\nDisables `yarn install` lifecycle scripts and adds a config file to\nspecify which scripts run.\n\nAdds:\n- `ignore-scripts true` to `.yarnrc`\n- `@kbn/yarn-install-scripts` CLI with:\n- `run`: runs allowed install scripts defined in\n`packages/kbn-yarn-install-scripts/config.json`\n - `scan`: lists packages with install scripts\n- Integration into `yarn kbn bootstrap`\n- CI check that fails if a new or updated package has an install script\nnot defined in `config.json`\n\nUsage:\n```\n$ yarn kbn bootstrap\n...\nsuccess yarn dependencies installed\nsuccess Playwright browsers installed\ninfo running allowlisted install scripts\n info Running 4 install script(s)...\n info Running install for chromedriver@143.0.4\n info Running postinstall for cypress@13.17.0\n info Running postinstall for esbuild@0.25.9\n info Running postinstall for geckodriver@6.1.0\n succ Install scripts complete\nsuccess install scripts completed\n\n$ node scripts/yarn_install_scripts run --dry-run\n info Running 4 install script(s)...\n info [dry-run] Would run install for chromedriver@143.0.1\n info [dry-run] Would run postinstall for cypress@13.17.0\n info [dry-run] Would run postinstall for esbuild@0.25.9\n info [dry-run] Would run postinstall for geckodriver@6.1.0\n succ Install scripts complete\n\n$ node scripts/yarn_install_scripts scan\n info ┌─────────────────────────┬──────────┬─────────┬─────────────┬─────────────────────────────────┐\n │ Package │ Status │ Version │ Lifecycle │ Script │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ chromedriver │ required │ 143.0.1 │ install │ node install.js │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ cypress │ required │ 13.17.0 │ postinstall │ node index.js --exec install │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ esbuild │ required │ 0.25.9 │ postinstall │ node install.js │\n ├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤\n │ ... │ ... │ ... │ ... │ ... │\n └─────────────────────────┴──────────┴─────────┴─────────────┴─────────────────────────────────┘\n succ Found 18 install scripts: 4 required, 14 skipped, 0 unconfigured\n```\nPart of https://github.com/elastic/kibana/issues/128025","sha":"d3e316fb87d7ced84abe0da160d08b249eb9d40b"}}]}] BACKPORT--> Co-authored-by: Jon <jon@elastic.co>
Disables `yarn install` lifecycle scripts and adds a config file to
specify which scripts run.
Adds:
- `ignore-scripts true` to `.yarnrc`
- `@kbn/yarn-install-scripts` CLI with:
- `run`: runs allowed install scripts defined in
`packages/kbn-yarn-install-scripts/config.json`
- `scan`: lists packages with install scripts
- Integration into `yarn kbn bootstrap`
- CI check that fails if a new or updated package has an install script
not defined in `config.json`
Usage:
```
$ yarn kbn bootstrap
...
success yarn dependencies installed
success Playwright browsers installed
info running allowlisted install scripts
info Running 4 install script(s)...
info Running install for chromedriver@143.0.4
info Running postinstall for cypress@13.17.0
info Running postinstall for esbuild@0.25.9
info Running postinstall for geckodriver@6.1.0
succ Install scripts complete
success install scripts completed
$ node scripts/yarn_install_scripts run --dry-run
info Running 4 install script(s)...
info [dry-run] Would run install for chromedriver@143.0.1
info [dry-run] Would run postinstall for cypress@13.17.0
info [dry-run] Would run postinstall for esbuild@0.25.9
info [dry-run] Would run postinstall for geckodriver@6.1.0
succ Install scripts complete
$ node scripts/yarn_install_scripts scan
info ┌─────────────────────────┬──────────┬─────────┬─────────────┬─────────────────────────────────┐
│ Package │ Status │ Version │ Lifecycle │ Script │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ chromedriver │ required │ 143.0.1 │ install │ node install.js │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ cypress │ required │ 13.17.0 │ postinstall │ node index.js --exec install │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ esbuild │ required │ 0.25.9 │ postinstall │ node install.js │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ ... │ ... │ ... │ ... │ ... │
└─────────────────────────┴──────────┴─────────┴─────────────┴─────────────────────────────────┘
succ Found 18 install scripts: 4 required, 14 skipped, 0 unconfigured
```
Part of elastic#128025
Disables `yarn install` lifecycle scripts and adds a config file to
specify which scripts run.
Adds:
- `ignore-scripts true` to `.yarnrc`
- `@kbn/yarn-install-scripts` CLI with:
- `run`: runs allowed install scripts defined in
`packages/kbn-yarn-install-scripts/config.json`
- `scan`: lists packages with install scripts
- Integration into `yarn kbn bootstrap`
- CI check that fails if a new or updated package has an install script
not defined in `config.json`
Usage:
```
$ yarn kbn bootstrap
...
success yarn dependencies installed
success Playwright browsers installed
info running allowlisted install scripts
info Running 4 install script(s)...
info Running install for chromedriver@143.0.4
info Running postinstall for cypress@13.17.0
info Running postinstall for esbuild@0.25.9
info Running postinstall for geckodriver@6.1.0
succ Install scripts complete
success install scripts completed
$ node scripts/yarn_install_scripts run --dry-run
info Running 4 install script(s)...
info [dry-run] Would run install for chromedriver@143.0.1
info [dry-run] Would run postinstall for cypress@13.17.0
info [dry-run] Would run postinstall for esbuild@0.25.9
info [dry-run] Would run postinstall for geckodriver@6.1.0
succ Install scripts complete
$ node scripts/yarn_install_scripts scan
info ┌─────────────────────────┬──────────┬─────────┬─────────────┬─────────────────────────────────┐
│ Package │ Status │ Version │ Lifecycle │ Script │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ chromedriver │ required │ 143.0.1 │ install │ node install.js │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ cypress │ required │ 13.17.0 │ postinstall │ node index.js --exec install │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ esbuild │ required │ 0.25.9 │ postinstall │ node install.js │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ ... │ ... │ ... │ ... │ ... │
└─────────────────────────┴──────────┴─────────┴─────────────┴─────────────────────────────────┘
succ Found 18 install scripts: 4 required, 14 skipped, 0 unconfigured
```
Part of elastic#128025
Disables `yarn install` lifecycle scripts and adds a config file to
specify which scripts run.
Adds:
- `ignore-scripts true` to `.yarnrc`
- `@kbn/yarn-install-scripts` CLI with:
- `run`: runs allowed install scripts defined in
`packages/kbn-yarn-install-scripts/config.json`
- `scan`: lists packages with install scripts
- Integration into `yarn kbn bootstrap`
- CI check that fails if a new or updated package has an install script
not defined in `config.json`
Usage:
```
$ yarn kbn bootstrap
...
success yarn dependencies installed
success Playwright browsers installed
info running allowlisted install scripts
info Running 4 install script(s)...
info Running install for chromedriver@143.0.4
info Running postinstall for cypress@13.17.0
info Running postinstall for esbuild@0.25.9
info Running postinstall for geckodriver@6.1.0
succ Install scripts complete
success install scripts completed
$ node scripts/yarn_install_scripts run --dry-run
info Running 4 install script(s)...
info [dry-run] Would run install for chromedriver@143.0.1
info [dry-run] Would run postinstall for cypress@13.17.0
info [dry-run] Would run postinstall for esbuild@0.25.9
info [dry-run] Would run postinstall for geckodriver@6.1.0
succ Install scripts complete
$ node scripts/yarn_install_scripts scan
info ┌─────────────────────────┬──────────┬─────────┬─────────────┬─────────────────────────────────┐
│ Package │ Status │ Version │ Lifecycle │ Script │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ chromedriver │ required │ 143.0.1 │ install │ node install.js │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ cypress │ required │ 13.17.0 │ postinstall │ node index.js --exec install │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ esbuild │ required │ 0.25.9 │ postinstall │ node install.js │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ ... │ ... │ ... │ ... │ ... │
└─────────────────────────┴──────────┴─────────┴─────────────┴─────────────────────────────────┘
succ Found 18 install scripts: 4 required, 14 skipped, 0 unconfigured
```
Part of elastic#128025
Disables `yarn install` lifecycle scripts and adds a config file to
specify which scripts run.
Adds:
- `ignore-scripts true` to `.yarnrc`
- `@kbn/yarn-install-scripts` CLI with:
- `run`: runs allowed install scripts defined in
`packages/kbn-yarn-install-scripts/config.json`
- `scan`: lists packages with install scripts
- Integration into `yarn kbn bootstrap`
- CI check that fails if a new or updated package has an install script
not defined in `config.json`
Usage:
```
$ yarn kbn bootstrap
...
success yarn dependencies installed
success Playwright browsers installed
info running allowlisted install scripts
info Running 4 install script(s)...
info Running install for chromedriver@143.0.4
info Running postinstall for cypress@13.17.0
info Running postinstall for esbuild@0.25.9
info Running postinstall for geckodriver@6.1.0
succ Install scripts complete
success install scripts completed
$ node scripts/yarn_install_scripts run --dry-run
info Running 4 install script(s)...
info [dry-run] Would run install for chromedriver@143.0.1
info [dry-run] Would run postinstall for cypress@13.17.0
info [dry-run] Would run postinstall for esbuild@0.25.9
info [dry-run] Would run postinstall for geckodriver@6.1.0
succ Install scripts complete
$ node scripts/yarn_install_scripts scan
info ┌─────────────────────────┬──────────┬─────────┬─────────────┬─────────────────────────────────┐
│ Package │ Status │ Version │ Lifecycle │ Script │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ chromedriver │ required │ 143.0.1 │ install │ node install.js │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ cypress │ required │ 13.17.0 │ postinstall │ node index.js --exec install │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ esbuild │ required │ 0.25.9 │ postinstall │ node install.js │
├─────────────────────────┼──────────┼─────────┼─────────────┼─────────────────────────────────┤
│ ... │ ... │ ... │ ... │ ... │
└─────────────────────────┴──────────┴─────────┴─────────────┴─────────────────────────────────┘
succ Found 18 install scripts: 4 required, 14 skipped, 0 unconfigured
```
Part of elastic#128025
In #250638 we moved lifecycle scripts to our own managed CLI. Currently we're running these scripts every time bootstrap is run. This updates bootstrap to only run scripts when the yarn integrity has changed, matching the previous behavior. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Bootstrap command now conditionally executes install scripts only when necessary, improving efficiency during the setup process. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
…5175) In elastic#250638 we moved lifecycle scripts to our own managed CLI. Currently we're running these scripts every time bootstrap is run. This updates bootstrap to only run scripts when the yarn integrity has changed, matching the previous behavior. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Bootstrap command now conditionally executes install scripts only when necessary, improving efficiency during the setup process. <!-- end of auto-generated comment: release notes by coderabbit.ai --> (cherry picked from commit c39c2de)
…5175) In elastic#250638 we moved lifecycle scripts to our own managed CLI. Currently we're running these scripts every time bootstrap is run. This updates bootstrap to only run scripts when the yarn integrity has changed, matching the previous behavior. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Bootstrap command now conditionally executes install scripts only when necessary, improving efficiency during the setup process. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
) (#256757) # Backport This will backport the following commits from `main` to `9.3`: - [[kbn_pm] Only install scripts when yarn integrity changes (#255175)](#255175) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Jon","email":"jon@elastic.co"},"sourceCommit":{"committedDate":"2026-03-09T18:35:28Z","message":"[kbn_pm] Only install scripts when yarn integrity changes (#255175)\n\nIn #250638 we moved lifecycle\nscripts to our own managed CLI.\n\nCurrently we're running these scripts every time bootstrap is run. This\nupdates bootstrap to only run scripts when the yarn integrity has\nchanged, matching the previous behavior.\n\n\n## Summary by CodeRabbit\n\n* **Bug Fixes**\n* Bootstrap command now conditionally executes install scripts only when\nnecessary, improving efficiency during the setup process.\n","sha":"c39c2ded7879074f8813592769e3499a6841f245","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Operations","release_note:skip","backport:all-open","v9.4.0"],"title":"[kbn_pm] Only install scripts when yarn integrity changes","number":255175,"url":"https://github.com/elastic/kibana/pull/255175","mergeCommit":{"message":"[kbn_pm] Only install scripts when yarn integrity changes (#255175)\n\nIn #250638 we moved lifecycle\nscripts to our own managed CLI.\n\nCurrently we're running these scripts every time bootstrap is run. This\nupdates bootstrap to only run scripts when the yarn integrity has\nchanged, matching the previous behavior.\n\n\n## Summary by CodeRabbit\n\n* **Bug Fixes**\n* Bootstrap command now conditionally executes install scripts only when\nnecessary, improving efficiency during the setup process.\n","sha":"c39c2ded7879074f8813592769e3499a6841f245"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/255175","number":255175,"mergeCommit":{"message":"[kbn_pm] Only install scripts when yarn integrity changes (#255175)\n\nIn #250638 we moved lifecycle\nscripts to our own managed CLI.\n\nCurrently we're running these scripts every time bootstrap is run. This\nupdates bootstrap to only run scripts when the yarn integrity has\nchanged, matching the previous behavior.\n\n\n## Summary by CodeRabbit\n\n* **Bug Fixes**\n* Bootstrap command now conditionally executes install scripts only when\nnecessary, improving efficiency during the setup process.\n","sha":"c39c2ded7879074f8813592769e3499a6841f245"}}]}] BACKPORT--> Co-authored-by: Jon <jon@elastic.co>
…5175) In elastic#250638 we moved lifecycle scripts to our own managed CLI. Currently we're running these scripts every time bootstrap is run. This updates bootstrap to only run scripts when the yarn integrity has changed, matching the previous behavior. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Bootstrap command now conditionally executes install scripts only when necessary, improving efficiency during the setup process. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
…5175) In elastic#250638 we moved lifecycle scripts to our own managed CLI. Currently we're running these scripts every time bootstrap is run. This updates bootstrap to only run scripts when the yarn integrity has changed, matching the previous behavior. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> * **Bug Fixes** * Bootstrap command now conditionally executes install scripts only when necessary, improving efficiency during the setup process. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
…5175) In elastic#250638 we moved lifecycle scripts to our own managed CLI. Currently we're running these scripts every time bootstrap is run. This updates bootstrap to only run scripts when the yarn integrity has changed, matching the previous behavior. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> * **Bug Fixes** * Bootstrap command now conditionally executes install scripts only when necessary, improving efficiency during the setup process. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Disables
yarn installlifecycle scripts and adds a config file to specify which scripts run.Adds:
ignore-scripts trueto.yarnrc@kbn/yarn-install-scriptsCLI with:run: runs allowed install scripts defined inpackages/kbn-yarn-install-scripts/config.jsonscan: lists packages with install scriptsyarn kbn bootstrapconfig.jsonUsage:
Part of #128025