Skip to content

Repair wp/5.4 branch Actions: Add a WP_ENV_MARIADB_VERSION environment variable - #577

Open
desrosj wants to merge 1 commit into
fix-actions-5.4/docker-compose-v2from
fix-actions-5.4/add-mariadb-version-option
Open

desrosj wants to merge 1 commit into
fix-actions-5.4/docker-compose-v2from
fix-actions-5.4/add-mariadb-version-option

Conversation

@desrosj

@desrosj desrosj commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

What?

Adds a WP_ENV_MARIADB_VERSION environment variable that chooses the MariaDB version wp-env uses. The database image in packages/env/lib/build-docker-compose-config.js changes from 'mariadb' to 'mariadb:${WP_ENV_MARIADB_VERSION:-latest}'. When the variable isn't set, the image resolves to mariadb:latest, the same image as before.

The README gets a note next to the existing port-variable note. Besides the variable, it says that MariaDB cannot start on a database written by a newer version, so before switching to a lower version, run wp-env stop, so wp-env start creates a new, empty database. (This branch has no wp-env destroy command; stop is enough because the database is kept in an unnamed Docker volume that a new container does not reuse.) It also says that with a version older than 11.4, wp db commands in the cli and tests-cli containers fail and wp-env clean leaves the database as it is: the MariaDB client in the wordpress:cli image requires TLS, and MariaDB servers before 11.4 do not offer it. WordPress itself is not affected.

packages/env/CHANGELOG.md gets an entry under the ## Master → New Feature list.

Why?

This branch's wp-env (1.0.1) 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 a mariadbVersion option and WP_ENV_MARIADB_VERSION environment variable to trunk. wp-env 1.0.1 has no version settings to extend, so only the environment variable is ported. Docker Compose fills it in when it reads the generated docker-compose.yml, the same way this file already uses WP_ENV_PORT/WP_ENV_TESTS_PORT in the port mappings.

This branch's wp-env runs one mysql service for both the development and tests environments, so a single image line changes.

This branch has no tests for the compose builder. npm run test-unit -- packages/env still passes all 22 tests locally. (packages/env/test/cli.js couldn't load locally because nodegit's native module wasn't built; that's unrelated to this change.)

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.

@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 added this pull request to stack #492 September 29, 2026 13:21
@desrosj
desrosj force-pushed the fix-actions-5.4/add-mariadb-version-option branch 3 times, most recently from c4fd689 to 6be70ff Compare October 6, 2026 14:34
@desrosj
desrosj removed this pull request from stack #492 October 7, 2026 01:38
@desrosj
desrosj added this pull request to stack #657 October 7, 2026 01:39
@desrosj
desrosj removed this pull request from stack #657 October 19, 2026 17:56
@desrosj
desrosj changed the base branch from fix-actions-5.4/docker-compose-v2 to wp/5.4 October 19, 2026 17:56
@desrosj
desrosj force-pushed the fix-actions-5.4/add-mariadb-version-option branch from 6be70ff to 081af1c Compare October 19, 2026 17:57
@desrosj
desrosj changed the base branch from wp/5.4 to fix-actions-5.4/docker-compose-v2 October 19, 2026 17:57
@desrosj
desrosj added this pull request to stack #743 October 19, 2026 17:57
@desrosj
desrosj force-pushed the fix-actions-5.4/add-mariadb-version-option branch from 081af1c to ac3e21e Compare October 19, 2026 19:14
@desrosj
desrosj force-pushed the fix-actions-5.4/add-mariadb-version-option branch 3 times, most recently from dc4b22f to 4ba8d72 Compare October 19, 2026 19:29
@desrosj
desrosj removed this pull request from stack #743 October 19, 2026 19:38
@desrosj
desrosj changed the base branch from fix-actions-5.4/docker-compose-v2 to wp/5.4 October 19, 2026 19:38
@desrosj
desrosj force-pushed the fix-actions-5.4/add-mariadb-version-option branch from 4ba8d72 to 1724c1c Compare October 19, 2026 19:38
@desrosj
desrosj changed the base branch from wp/5.4 to fix-actions-5.4/docker-compose-v2 October 19, 2026 19:39
@desrosj
desrosj added this pull request to stack #756 October 19, 2026 19:39
@desrosj
desrosj marked this pull request as ready for review October 20, 2026 17:13
@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 force-pushed the fix-actions-5.4/add-mariadb-version-option branch from 1724c1c to 6e8e0ff Compare October 20, 2026 17:21
@desrosj
desrosj removed this pull request from stack #756 October 20, 2026 19:27
@desrosj
desrosj changed the base branch from fix-actions-5.4/docker-compose-v2 to wp/5.4 October 20, 2026 19:27
@desrosj
desrosj force-pushed the fix-actions-5.4/add-mariadb-version-option branch from 6e8e0ff to b65b65f Compare October 20, 2026 19:28
@desrosj
desrosj changed the base branch from wp/5.4 to fix-actions-5.4/docker-compose-v2 October 20, 2026 19:29
@desrosj
desrosj added this pull request to stack #802 October 20, 2026 19:29
@desrosj
desrosj removed this pull request from stack #802 October 20, 2026 23:44
@desrosj
desrosj changed the base branch from fix-actions-5.4/docker-compose-v2 to wp/5.4 October 20, 2026 23:45
@desrosj
desrosj force-pushed the fix-actions-5.4/add-mariadb-version-option branch from b65b65f to 64ab661 Compare October 20, 2026 23:46
@desrosj
desrosj changed the base branch from wp/5.4 to fix-actions-5.4/docker-compose-v2 October 20, 2026 23:52
@desrosj
desrosj added this pull request to stack #817 October 20, 2026 23:52
@desrosj
desrosj removed this pull request from stack #817 October 21, 2026 12:58
@desrosj
desrosj added this pull request to stack #833 October 21, 2026 12:59
@desrosj
desrosj removed this pull request from stack #833 October 21, 2026 20:45
@desrosj
desrosj added this pull request to stack #845 October 21, 2026 20:45

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant