Skip to content

feat(runtime): add initial Docker-backed wordpress-native backend - #2580

Draft
chubes4 wants to merge 1 commit into
mainfrom
fix/issue-2578-native-backend
Draft

chubes4 wants to merge 1 commit into
mainfrom
fix/issue-2578-native-backend

Conversation

@chubes4

@chubes4 chubes4 commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Refs #2578 (first slice). Part of #2473.

What this adds

  • New runtime backend wordpress-native, registered through the existing RuntimeBackendProvider contract. Playground stays the default, and the wordpress alias still resolves to Playground.
  • Two Docker containers:
    • PHP: php:<ver>-apache, pinned by digest, with mysqli, gd, intl, zip, exif, in-memory OPcache and WP-CLI.
    • Database: mariadb:11.4 on tmpfs, on a private per-run network.
    • WordPress core is resolved the same way Playground resolves it, and MountSpec mounts become bind mounts.
  • wordpress.run-php runs over HTTP through Apache, so every command shares the in-memory OPcache. A fresh php CLI process would start with an empty cache.
  • wordpress.wp-cli runs inside the PHP container. Any other command returns wordpress-native-command-unsupported without booting Docker.
  • Provenance: the run records the PHP version, image ID, base image digest, MariaDB version and OPcache status in RuntimeInfo.
  • Teardown: destroy removes the containers, volume, network and temp dir. A failed boot or an aborted command triggers it too.
  • No Docker: fails fast with wordpress-native-docker-unavailable.

Not in this slice (follow-ups before Extra Chill journeys can use it)

  • Subdomain multisite install, plus mapped hosts.
  • Blueprints: any blueprint is rejected right now, including an empty { steps: [] }, which recipes commonly send. An empty blueprint should be allowed.
  • WP-CLI version: the phar is downloaded from gh-pages without a pinned version. Pin it.
  • Package layout: this lives in runtime-playground so it can reuse php-bootstrap, commands and the artifact helpers. It may belong in its own package once the browser half (Native runtime backend: browser-actions and browser-probe against the native web server #2579) lands.

Tests

  • npm run build passes.
  • npx tsx --test tests/native-runtime.test.ts:
    • 2 unit tests pass: registration, and the structured result for an unsupported command.
    • The Docker integration test (boot, run-php printing the PHP version and OPcache status, wp-cli option get siteurl, then checking every resource is removed) passed on the Lab with Docker, according to the cook. It skips on a host without Docker.

Provenance

  • Cooked by Homeboy on the Lab (agent-task-8cfca45e).
  • Homeboy's verification failed in setup: it ran npm ci from packages/cli, not the repo root. That's infrastructure, not this code.
  • I recovered the candidate commit from the Lab workspace, squashed it, and re-verified the build and unit tests locally.

🤖 AI disclosure: written by an AI agent (Homeboy cook) and reviewed by Extra Chill Bot (Claude).

@chubes4

chubes4 commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

Parked as a draft (Chris's call). In-memory OPcache on Playground (#2581, Extra-Chill/extrachill#483) roughly halved journey time, so the native backend is no longer needed for speed. This PR stays the starting point for #2578/#2473 when we need timings that match production. Before journeys can use it, it still needs subdomain multisite, empty-blueprint acceptance, a pinned WP-CLI, and the browser half (#2579).

🤖 Extra Chill Bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant