Skip to content

Repair wp/5.9 branch Actions: Add a mariadbVersion option to wp-env - #581

Closed
desrosj wants to merge 1 commit into
fix-actions-5.9/fix-activate-theme-navigation-racefrom
fix-actions-5.9/add-mariadb-version-option
Closed

desrosj wants to merge 1 commit into
fix-actions-5.9/fix-activate-theme-navigation-racefrom
fix-actions-5.9/add-mariadb-version-option

Conversation

@desrosj

@desrosj desrosj commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

What?

Adds a mariadbVersion option to .wp-env.json and a WP_ENV_MARIADB_VERSION environment variable, so the MariaDB version wp-env uses can be chosen.

  • The option can be set at the top level or per environment (env.development, env.tests), like phpVersion.
  • WP_ENV_MARIADB_VERSION overrides both environments.
  • Accepted values are "lts", "latest", or a numeric version such as "10.11" or "11.4.2". Anything else fails with a validation error, including an invalid WP_ENV_MARIADB_VERSION value.
  • When no version is set, the database image stays mariadb, exactly as before. A set version becomes mariadb:<version> on the mysql and tests-mysql services.

The README gets a table row and a "Specific MariaDB Version" section, and packages/env/CHANGELOG.md gets an entry under Unreleased.

The README section also says:

  • MariaDB cannot start on a database written by a newer version, so before switching to a lower version, run wp-env destroy. It removes the environment's Docker containers, volumes, networks, and local files, not only the databases.
  • With a mariadbVersion older than 11.4, wp db commands in the cli containers fail and wp-env clean leaves the database as it is. The MariaDB client in the CLI image requires TLS when phpVersion is unset or 8.1 or newer, and MariaDB servers before 11.4 do not offer it. WordPress itself is not affected.
  • MariaDB 5.5 images are not published for ARM processors. Apple silicon devices can run 5.5 under emulation with DOCKER_DEFAULT_PLATFORM=linux/amd64, which emulates every container in the environment, not only the database.

Why?

This branch's wp-env (4.1.3) always runs the floating mariadb image, which today is a MariaDB release many years newer than anything this branch was tested against. There is currently no way to pin an older, era-appropriate version for testing.

How?

This follows #83751, which adds the same option and environment variable to trunk. This branch's wp-env keeps its configuration in packages/env/lib/config/config.js, so the change follows how phpVersion works there:

  • validateConfig() checks the value (the new checkMariaDBVersion()).
  • parse-config.js passes it through.
  • config.js adds the default and applies WP_ENV_MARIADB_VERSION. Unlike WP_ENV_PHP_VERSION, the new variable is validated.
  • build-docker-compose-config.js sets each environment's image.

New tests in packages/env/lib/config/test/config.js cover the default, root and per-environment values, the environment-variable override, and both validation errors. New tests in packages/env/test/build-docker-compose-config.js cover the image with and without a version. The config snapshot gains "mariadbVersion": null. npm run test-unit -- packages/env passes all 90 tests locally.

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.

@desrosj
desrosj added this pull request to stack #570 September 29, 2026 13:24
@github-actions

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 force-pushed the fix-actions-5.9/add-mariadb-version-option branch from 3435a97 to df40efb Compare October 5, 2026 20:44
@desrosj
desrosj force-pushed the fix-actions-5.9/add-mariadb-version-option branch from df40efb to 5e0aaec Compare October 5, 2026 20:48
@desrosj
desrosj removed this pull request from stack #570 October 5, 2026 20:49
@desrosj
desrosj added this pull request to stack #616 October 5, 2026 20:49
@desrosj
desrosj force-pushed the fix-actions-5.9/add-mariadb-version-option branch from 5e0aaec to 722e4ce Compare October 5, 2026 21:13
@desrosj
desrosj force-pushed the fix-actions-5.9/add-mariadb-version-option branch from 722e4ce to 4b192ab Compare October 6, 2026 17:49
@desrosj
desrosj removed this pull request from stack #616 October 6, 2026 18:27
@desrosj
desrosj added this pull request to stack #636 October 6, 2026 18:28
@desrosj
desrosj removed this pull request from stack #636 October 7, 2026 00:58
@desrosj
desrosj added this pull request to stack #643 October 7, 2026 00:59
@desrosj
desrosj removed this pull request from stack #643 October 7, 2026 18:02
@desrosj
desrosj changed the base branch from fix-actions-5.9/fix-activate-theme-navigation-race to wp/5.9 October 7, 2026 18:02
@desrosj
desrosj force-pushed the fix-actions-5.9/add-mariadb-version-option branch from 4b192ab to 3605eee Compare October 7, 2026 18:04
@desrosj
desrosj changed the base branch from wp/5.9 to fix-actions-5.9/fix-activate-theme-navigation-race October 7, 2026 18:05
@desrosj
desrosj added this pull request to stack #668 October 7, 2026 18:06
@desrosj
desrosj removed this pull request from stack #668 October 8, 2026 19:35
@desrosj
desrosj force-pushed the fix-actions-5.9/add-mariadb-version-option branch from 3605eee to 76701d5 Compare October 8, 2026 19:35
@desrosj
desrosj added this pull request to stack #695 October 8, 2026 19:35
@desrosj
desrosj marked this pull request as ready for review October 9, 2026 16:35
@github-actions

github-actions Bot commented Oct 9, 2026

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 commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

Moved to WordPress#84410.

@desrosj desrosj closed this Oct 9, 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