Skip to content

Repair wp/5.5 branch Actions: Create the wp-env development and tests databases - #629

Closed
desrosj wants to merge 1 commit into
fix-actions-5.5/add-mariadb-version-optionfrom
fix-actions-5.5/create-wp-env-databases
Closed

desrosj wants to merge 1 commit into
fix-actions-5.5/add-mariadb-version-optionfrom
fix-actions-5.5/create-wp-env-databases

Conversation

@desrosj

@desrosj desrosj commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

What?

Creates the wordpress and tests-wordpress databases that wp-env uses. The mysql service now sets MYSQL_DATABASE: wordpress, and a new tests-mysql service (same mariadb:${WP_ENV_MARIADB_VERSION:-latest} image, its own mysql-test volume) sets MYSQL_DATABASE: tests-wordpress. tests-wordpress, tests-cli and phpunit now set WORDPRESS_DB_HOST: tests-mysql, and tests-cli and phpunit also set WORDPRESS_DB_NAME: tests-wordpress.

Why?

"Install WordPress" in the PHP unit test jobs fails with Error: Can’t select database, because the wordpress database does not exist. The mysql service only sets MYSQL_ALLOW_EMPTY_PASSWORD, so nothing creates either database: the wordpress image's entrypoint used to run CREATE DATABASE from WORDPRESS_DB_NAME, and docker-library/wordpress#557 removed that in January 2021. Below the health check PR (#598) this was hidden by the earlier wp db check TLS failure.

The wp-config.php the image now writes reads every database setting with getenv_docker(), so each container gets the values from its own environment. Reproduced locally with this branch's wp-env and the current images: tests-cli and phpunit have no WORDPRESS_DB_NAME, so they resolve DB_NAME to the wordpress default, and the tests environment would be installed into the development database. cli resolves to wordpress and mysql by default, which is already right, so it is unchanged.

How?

A minimal backport of the database part of #29800 (WordPress@f8052e1), which wp/5.7 and later already have. It keeps this branch's empty root password (MYSQL_ALLOW_EMPTY_PASSWORD, WORDPRESS_DB_PASSWORD: '') rather than switching to MYSQL_ROOT_PASSWORD, and leaves out makeConfigWritable: the wordpress image's entrypoint already makes wp-config.php owned by www-data, and every wp config set call succeeds without it. #598 gives tests-mysql the same health check and MARIADB_AUTO_UPGRADE as mysql, and tests-wordpress waits for tests-mysql to be healthy.

Use of AI Tools

This PR was created by Claude Code under my supervision. All code should be treated as AI-produced and not yet reviewed by a human until this PR is marked Ready for Review.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

🤖 PR meta 🤖

🏷️ 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.

@desrosj
desrosj added this pull request to stack #632 October 6, 2026 16:15
@desrosj
desrosj force-pushed the fix-actions-5.5/create-wp-env-databases branch from 6713f9a to 4ea315e Compare October 8, 2026 18:08
@desrosj
desrosj removed this pull request from stack #632 October 8, 2026 18:10
@desrosj
desrosj force-pushed the fix-actions-5.5/create-wp-env-databases branch from 4ea315e to fcdabf9 Compare October 8, 2026 18:11
@desrosj
desrosj added this pull request to stack #692 October 8, 2026 18:11
@desrosj
desrosj removed this pull request from stack #692 October 9, 2026 19:59
@desrosj
desrosj changed the base branch from fix-actions-5.5/add-mariadb-version-option to wp/5.5 October 9, 2026 20:00
@desrosj
desrosj force-pushed the fix-actions-5.5/create-wp-env-databases branch from fcdabf9 to 2699d42 Compare October 9, 2026 20:01
@desrosj
desrosj changed the base branch from wp/5.5 to fix-actions-5.5/add-mariadb-version-option October 9, 2026 20:02
@desrosj
desrosj added this pull request to stack #723 October 9, 2026 20:02
@desrosj
desrosj marked this pull request as ready for review October 16, 2026 17:14
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

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: desrosj <desrosj@git.wordpress.org>

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

@desrosj
desrosj removed this pull request from stack #723 October 16, 2026 17:36
@desrosj
desrosj added this pull request to stack #739 October 16, 2026 17:36
@desrosj
desrosj force-pushed the fix-actions-5.5/create-wp-env-databases branch from 2699d42 to 9ebf842 Compare October 16, 2026 17:47
@desrosj

desrosj commented Oct 16, 2026

Copy link
Copy Markdown
Owner Author

Moved to WordPress#85009.

@desrosj desrosj closed this Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant