Automattic / Automattic/wp-codebox

editor-validate-blocks: support batch validation (one browser session for many posts) — per-site browser launch is too slow at corpus scale

Open
#1,628 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
16
Forks
4
Avg merge
59m
Merged PRs (30d)
131

Description

## Problem
`wordpress.editor-validate-blocks` (#1593) launches a browser + loads the editor **per invocation**. Running it across a fixture-matrix lane (e.g. 30 sites) calls it once per site → each a fresh browser/editor boot. A 30-site lane run timed out before completing a single batch (browser-per-site overhead dominates). So real `validateBlock` editor-validity can't currently be measured at corpus scale.

## Ask
Make editor-validation **batch-capable**: accept multiple posts/contents in a single invocation and validate them all in **one browser/editor session** (boot the editor once, loop the contents through `wp.blocks.parse` + `validateBlock`, return an array of per-item results). The downstream matrix would then call it once per batch instead of once per site, amortizing the browser boot.

Schema: input a list of `{id, content}` (or post IDs); output `[{id, total_blocks, valid_blocks, invalid_blocks, results:[…]}]` — same per-item shape as the single-post command, just batched.

## Impact
Unblocks at-scale editor-validity verification (the definitive "are imported blocks editor-valid across the corpus" signal), which is currently impractical due to per-site boot cost.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the existing wordpress.editor-validate-blocks command and trace how it launches the browser and editor for one invocation. Add batch input and per-item output while reusing one browser/editor session, then verify that each item reports total_blocks, valid_blocks, invalid_blocks, and results.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, wordpress
Domain
testing-qa, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.