feat(runtime-services): support isolated external MySQL providers#2046
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
externalprovider for MySQL-compatible runtime services while preserving Docker as the defaultProvider contract
Recipes select
configuration.provider: external, reference a namedconfiguration.externalServiceboundary, and declarehostEnv, optionalportEnv,usernameEnv, andpasswordEnvreferences. The referenced values are read from the host environment during provisioning; recipes, plans, lifecycle evidence, and runtime metadata contain only environment variable names.The referenced boundary must explicitly allowlist the resolved host and declare
writes: allowed-with-approval. The resolved runtime policy must allow that host and useapprovals: on-write; execution must also pass--approve-external-service-writes. Any missing or mismatched layer fails beforemysqlormariadbis spawned.The provider supports independent
mysqlandmariadbcapability declarations viaconfiguration.engine. Native clients connect with argument arrays, receive passwords throughMYSQL_PWD, receive SQL through stdin, and have stdout/stderr capped at 1 MiB per stream. Overflow kills the child and returns bounded diagnostics. Docker behavior and defaults are unchanged.Threat model and isolation
Secret delivery and evidence
Administrative passwords and generated workload passwords never enter argv, recipes, plans, errors, observations, snapshots, command evidence,
wp-config.php, auto-prepend PHP, request-worker payloads, or persisted artifact paths.Both Docker and external providers return database passwords only in
secretEnv; the non-secretenvresult omitsDB_PASSWORD. For external database runs,wp-config.phpreferencesgetenv('DB_PASSWORD')and WP Codebox attaches the password only to the in-memoryenvof each Playground PHP run. External database runtimes disable the file-backed request-worker path, preventing transient payload serialization. Recursive post-disposal scans verify the generated password is absent from artifact and WordPress directories while the PHP execution receives it through the ephemeral environment.Persisted run attestation merges generated secret metadata with declared secret metadata.
secretEnvelope.countand names are accurate, generated entries usesource: managed-runtime-service, and values remain excluded under the names-only redaction contract.Lifecycle evidence remains provider-neutral: provider/version declaration, pending/ready/failed readiness, provisioning/provisioned/released/failed lifecycle, teardown completion/failure, interruption/readiness/provision/teardown diagnostics, and control results.
Follow-up integration
Extra-Chill/homeboy-extensions#2408 can select this provider, declare the release-host database boundary and policy, map its administration environment into the four generic references, and pass explicit write approval for the isolated test lifecycle. No host, repository, vendor, project, or production-path behavior is embedded here.
Tests
npm run buildnpm run test:runtime-servicesnpm run test:runtime-services-lifecyclenpx tsx tests/playground-cli-runner-bootstrap-ini.test.tsnpm run test:redactionnpm run test:recipe-secret-envnpm run test:schema-paritynpm run test:recipe-validation-descriptorsgit diff --checknpm run test:disposable-mysql-mysqli-e2eis included in PR CI; the local host has no Docker, so the local invocation reports its explicit Docker-unavailable skip. The repository has no configuredlintscript.Closes #2043