[9.3] Manage yarn install scripts (#250638)#250832
Merged
jbudz merged 2 commits intoelastic:9.3from Jan 29, 2026
Merged
Conversation
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto9.3:Questions ?
Please refer to the Backport tool documentation