Skip to content

wp-env: Apply SQLite path settings before Playground installation - #84109

Open
JanJakes wants to merge 1 commit into
WordPress:trunkfrom
JanJakes:wp-env-database-config
Open

JanJakes wants to merge 1 commit into
WordPress:trunkfrom
JanJakes:wp-env-database-config

Conversation

@JanJakes

@JanJakes JanJakes commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

What?

Fix custom SQLite database paths in wp-env's Playground runtime so installation and requests use the same database.

Why?

The generated Blueprint applies configuration constants after WordPress installation. Setting DB_PATH or a legacy path setting at that point switches subsequent requests to an empty database.

This also affects older SQLite integration releases; it is not a regression from randomized storage.

How?

Pass DB_PATH, DB_DIR, DB_FILE, FQDBDIR, and FQDB through Playground's startup --define options and omit them from the later Blueprint step. Leave other configuration values and Blueprint steps unchanged.

Focused tests cover argument generation, the spawned Playground command, default storage, legacy settings, and preservation of other configuration values.

Testing Instructions

  1. Add the following settings to a test project's .wp-env.override.json:

    {
      "config": {
        "DB_DIR": "/wordpress/custom-database",
        "DB_FILE": "custom.sqlite"
      }
    }
  2. Start that project with this branch's wp-env using wp-env start --runtime=playground.

  3. Open /wp-admin/ and confirm that WordPress is installed. Create a draft post and reload the page to confirm that it remains available.

  4. Stop the environment, remove the custom database settings, and repeat to check default storage.

Compatibility was also checked with SQLite integration releases 2.2.23 and 3.0.2, and a plugin ZIP built from 4163f69, which supports DB_PATH and randomized storage. Those checks verified the active path, installation state, plugin activation, and saved data across multiple PHP workers.

@github-actions github-actions Bot added the [Tool] Env /packages/env label Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

👋 Welcome

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @JanJakes! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: JanJakes <janjakes@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

🏷️ Labels

This pull request needs exactly one label indicating its type, and has 0.

  • Required: any label starting with [Type].
  • Found: none.

Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you.

Pass DB_PATH and the legacy SQLite storage constants through Playground's
startup options so installation and later requests use the same database.
Keep other configuration constants in the existing Blueprint step.

Cover default storage, custom and legacy paths, null values, and unrelated
configuration behavior with focused tests.
@JanJakes
JanJakes force-pushed the wp-env-database-config branch from 0cd714e to 765e732 Compare October 6, 2026 11:28
@github-actions github-actions Bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Oct 6, 2026
@JanJakes
JanJakes marked this pull request as ready for review October 7, 2026 11:02
@JanJakes
JanJakes requested a review from t-hamano as a code owner October 7, 2026 11:02

This branch has not been deployed

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

Labels

First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Tool] Env /packages/env

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant