Skip to content

[9.1] Manage yarn install scripts (#250638)#250920

Merged
jbudz merged 1 commit intoelastic:9.1from
jbudz:backport/250638/9.1
Jan 30, 2026
Merged

[9.1] Manage yarn install scripts (#250638)#250920
jbudz merged 1 commit intoelastic:9.1from
jbudz:backport/250638/9.1

Conversation

@jbudz
Copy link
Copy Markdown
Contributor

@jbudz jbudz commented Jan 29, 2026

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
@jbudz jbudz requested a review from kibanamachine as a code owner January 29, 2026 15:00
@jbudz jbudz added the backport This PR is a backport of another PR label Jan 29, 2026
@jbudz jbudz requested a review from a team January 29, 2026 17:11
@jbudz jbudz merged commit 3fa6e81 into elastic:9.1 Jan 30, 2026
17 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