Skip to content

Add disposable MySQL runtime service primitive - #1816

Merged
chubes4 merged 11 commits into
mainfrom
feat/1813-disposable-mysql-service
Jul 16, 2026
Merged

Add disposable MySQL runtime service primitive#1816
chubes4 merged 11 commits into
mainfrom
feat/1813-disposable-mysql-service

Conversation

@chubes4

@chubes4 chubes4 commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a generic managed runtime-service schema with stable ids and explicit provider-output-to-runtime-env mappings
  • provision disposable MySQL 8.4 through Docker on a loopback ephemeral port with tmpfs storage and protocol-level readiness before PHP-WASM starts
  • integrate interruption-safe, timeout-safe, idempotent teardown and reviewer-safe persisted lifecycle evidence
  • expose validation and dry-run plans, deterministic lifecycle/provider coverage, and a registered PHP-WASM mysqli E2E

Closes #1813.

Compatibility

This is additive for recipes that do not declare inputs.services. Existing recipe and runtime behavior remains unchanged. The schema stays provider-neutral at the recipe boundary; the initial mysql kind is implemented by Docker, and consumers explicitly choose their own environment variable names. No WPCOM-specific names, paths, or database naming policy are encoded.

Evidence

Source relationship: this implements the generic managed-service direction and acceptance criteria in #1813, informed by the linked downstream WPCOM contract and PHP-WASM MySQL readiness constraints.

Change kind: additive runtime-core contract, Docker MySQL provider, CLI orchestration/evidence integration, validation/dry-run surface, deterministic tests, and one registered live integration test.

Verification capability: deterministic tests use injected provider dependencies to prove protocol readiness behavior, loopback ephemeral publication, tmpfs/no persistent volume, credential redaction, Docker context preservation, environment collision validation, timeout/interruption cleanup, already-absent idempotency, and persisted cleanup evidence. The Docker-capable live E2E runs the public recipe lifecycle and PHP-WASM mysqli query.

Runtime scope: runtime changes are limited to recipes that explicitly declare managed services. The post-review hardening only closes demonstrated ownership gaps during timeout/interruption, preserves the selected Docker daemon context, and treats absence of an --rm container as successful teardown; it does not alter unrelated runtime functionality.

A Docker-capable Lab host already passed the live mysqli E2E and left zero wp-codebox containers. On the current non-Docker host, the registered package smoke reported its explicit Docker-unavailable skip while all deterministic coverage passed.

Fresh-Checkout Testing

  1. git clone https://github.com/Automattic/wp-codebox.git
  2. cd wp-codebox && git checkout feat/1813-disposable-mysql-service
  3. npm ci
  4. npm run build
  5. npm run test:runtime-services
  6. npm run test:runtime-services-lifecycle
  7. npm run smoke -- --group package
  8. On a Docker-capable host, run npm run test:disposable-mysql-mysqli-e2e.
  9. Confirm teardown left no service containers with docker ps -a --filter name=wp-codebox --format "{{.ID}}"; the command must print nothing.

AI Assistance

OpenCode with OpenAI GPT-5.6 Sol assisted with review, focused implementation hardening, test coverage, rebase verification, and PR preparation.

@chubes4
chubes4 merged commit 2a5f809 into main Jul 16, 2026
2 checks passed
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.

Add disposable MySQL runtime service primitive

1 participant