Skip to content

[9.3] Manage yarn install scripts (#250638)#250832

Merged
jbudz merged 2 commits intoelastic:9.3from
kibanamachine:backport/9.3/pr-250638
Jan 29, 2026
Merged

[9.3] Manage yarn install scripts (#250638)#250832
jbudz merged 2 commits intoelastic:9.3from
kibanamachine:backport/9.3/pr-250638

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.3:

Questions ?

Please refer to the Backport tool documentation

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)
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Jan 28, 2026
@kibanamachine kibanamachine enabled auto-merge (squash) January 28, 2026 22:23
@jbudz jbudz disabled auto-merge January 29, 2026 14:33
@jbudz jbudz merged commit ab948df into elastic:9.3 Jan 29, 2026
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants