Automattic / Automattic/wp-codebox

Preflight the pinned Playwright browser before browser-bearing recipes

Aperta
#2,185 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
16
Fork
4
Merge medio
59m
PR unite (30g)
131

Descrizione

## Problem

Browser-dependent recipes can perform the full WordPress setup/import and fail only when the first browser step launches because the exact Playwright-managed Chromium revision is absent. `wp-codebox doctor --json` currently checks Node, npm, the CLI, processes, temp runtimes, and archives, but does not check the browser executable required by the installed WP Codebox Playwright version.

This is especially fragile on hosts with multiple Playwright consumers: running another package's `playwright install chromium` can prune browser revisions that it considers unused, including the revision required by WP Codebox.

## Reproduction

Installed runtime:

```text
wp-codebox 0.18.0
Playwright expected chromium_headless_shell-1234
```

1. Run `wp-codebox doctor --json`; browser readiness is not represented and the command reports no browser error.
2. Ensure `/Users//Library/Caches/ms-playwright/chromium_headless_shell-1234` is absent.
3. Run a recipe containing `wordpress.editor-open`, `wordpress.editor-validate-blocks`, or `wordpress.visual-compare`.
4. WordPress setup and import proceed, then each browser command fails with:

```text
browserType.launch: Executable doesn't exist at .../chromium_headless_shell-1234/...
Please run the following command to download new browsers: npx playwright install
```

Observed in Homeboy run `701cfb6c-2850-4d20-8b39-d813494cc167` while processing Blocks Engine fixture `89-static-site-importer-architecture`. The child recipe spent 85 seconds before surfacing three browser-step failures.

Installing the browser through the Playwright binary owned by the installed WP Codebox package and replaying the same workload succeeded: Homeboy run `2d788144-6209-4b5c-b39e-d6798e2b49fe`.

## Expected

- `wp-codebox doctor` verifies the exact browser executable required by the installed runtime.
- Browser-bearing recipe preflight fails before WordPress boot/import when that executable is absent.
- Diagnostics provide a command bound to the installed WP Codebox package/version, rather than an ambient `npx playwright install` that may select another package version.
- If `doctor --fix` owns browser installation, it installs only the pinned required revision and reports the resulting executable path/version.
- Deterministic coverage simulates a missing pinned browser without depending on the operator's global Playwright cache.

AI assistance: GPT-5.6 Sol via OpenCode diagnosed the failed run and drafted this report. Chris Huber owns the issue and acceptance criteria.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia dagli entry point wp-codebox doctor --json e doctor --fix, quindi segui preflight per le ricette che contengono wordpress.editor-open, wordpress.editor-validate-blocks o wordpress.visual-compare. Verifica l’eseguibile bloccato del runtime WP Codebox Playwright installato senza usare il comando npx presente nell’ambiente. Il lavoro è completato quando gli errori dovuti alla mancanza del browser si verificano prima della configurazione/importazione di WordPress e la copertura deterministica riporta il comando di installazione associato e il percorso dell’eseguibile.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
playwright, typescript
Ambito
cli, testing-qa, tooling
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.