Repository navigation
Repair wp/6.8 branch Actions: Replace wp-env's database check with a MariaDB health check - #83863
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 ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Size Change: 0 B Total Size: 1.85 MB ℹ️ View Unchanged
|
9b7fe73 to
8d74e4a
Compare
6d209f2 to
d4e0e2a
Compare
d4e0e2a to
70103fa
Compare
|
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 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. |
70103fa to
fab7899
Compare
fab7899 to
c203055
Compare
c203055 to
e7ccd0c
Compare
e7ccd0c to
924640f
Compare
Part of #82786.
What?
Ports #75046 ("wp-env: Fix MySQL startup race condition causing database connection errors") to this branch's
wp-env:mysqlandtests-mysql) share a health check (MARIADB_HEALTHCHECK), plusMARIADB_AUTO_UPGRADEso existing databases get the userhealthcheck.shneeds. It runs MariaDB'shealthcheck.sh --connect --innodb_initializedonly when the data directory has.my-healthcheck.cnfand the image hashealthcheck.sh. Otherwise it pings the server over TCP on127.0.0.1withmariadb-admin(11.0 and newer only ship this name) ormysqladmin(versions before 10.4 only ship this name).wordpressandtests-wordpressdepend on their database withcondition: service_healthy, so Docker Compose only starts WordPress once MariaDB is ready.wp db checkconnection check, its 30-second retry loop and the extra 4-second sleep are removed fromwp-env start.wp-env startstartsmysqlandtests-mysqltogether, andwp-env cleanstarts only the database(s) it resets.packages/env/CHANGELOG.mdgets trunk's entry, extended to describe the fallback ping, with links to wp-env: Fix MySQL startup race condition causing database connection errors #75046 and Env: Add an option to choose the MariaDB version #83751.wp dbcommands with amariadbVersionolder than 11.4 now says thatwp-env startand WordPress itself are not affected, sincewp-env startno longer runswp db check.Why?
wp db checkrunsmariadb-checkin theclicontainer. The client in the currentwordpress:cliimage (MariaDB 11.8) requires TLS by default, and WP-CLI runs it with--no-defaults, so nothing can turn that off. Any database without TLS, which means every MariaDB release before 11.4, fails withTLS/SSL error: SSL is required, but the server does not support itand stopswp-env start.This branch pins MariaDB
11.4, which has TLS, so it isn't failing today. This brings its startup in line withtrunk, which removedwp db checkfor the same readiness problem, and keepswp-env startworking if the pin or the CLI image changes.How?
The changes follow #75046 hunk for hunk, adapted to this branch's file layout (
commands/start.js,commands/clean.jsandwordpress.js), except the health check command, which is #83751's runtime check (at e02f866).#75046's health check runs
healthcheck.shunconditionally, which doesn't work for every version themariadbVersionoption allows. MariaDB 10.2 and 10.3 images ship the script without the healthcheck user, images built before 2022 and older patch tags (such as10.5.8and10.6.4) have no script at all, and a data volume written by a newer image keeps.my-healthcheck.cnfwhen an older image without the script runs on it. Those databases would never become healthy, so WordPress would never start. The check is decided at runtime rather than by image tag, so every version, includingltsandlatest, uses the same check.#75046's two compose-builder tests are ported, and new tests run the health check command through
/bin/shwith stub tools for each path (skipped on Windows).Verified locally: this branch's
11.4pin becomes healthy throughhealthcheck.sh, and"mariadbVersion": "10.3"through the ping.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