Repository navigation
Repair wp/5.4 branch Actions: Add a WP_ENV_MARIADB_VERSION environment variable - #85605
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
andrewserong
left a comment
There was a problem hiding this comment.
Nice and simple, LGTM!
4ab23a1 to
c408f2f
Compare
Part of #83419.
What?
Adds a
WP_ENV_MARIADB_VERSIONenvironment variable that chooses the MariaDB versionwp-envuses. The database image inpackages/env/lib/build-docker-compose-config.jschanges from'mariadb'to'mariadb:${WP_ENV_MARIADB_VERSION:-latest}'. When the variable isn't set, the image resolves tomariadb: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, sowp-env startcreates a new, empty database. (This branch has nowp-env destroycommand;stopis 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 dbcommands in thecliandtests-clicontainers fail andwp-env cleanleaves the database as it is: the MariaDB client in thewordpress:cliimage requires TLS, and MariaDB servers before 11.4 do not offer it. WordPress itself is not affected.packages/env/CHANGELOG.mdgets an entry under the## Master→ New Feature list.Why?
This branch's
wp-env(1.0.1) always runs the floatingmariadbimage, 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
mariadbVersionoption andWP_ENV_MARIADB_VERSIONenvironment variable totrunk.wp-env1.0.1 has no version settings to extend, so only the environment variable is ported. Docker Compose fills it in when it reads the generateddocker-compose.yml, the same way this file already usesWP_ENV_PORT/WP_ENV_TESTS_PORTin the port mappings.This branch's
wp-envruns onemysqlservice 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/envstill passes all 22 tests locally. (packages/env/test/cli.jscouldn't load locally becausenodegit'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.