Repository navigation
Repair wp/5.2 branch Actions: Run WP-CLI directly in the cli containers - #85653
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.
This seems reasonable to me! I guess the alternative would be to update the commands, which would be a larger diff. And with this PR, if for some reason someone really wants or needs to execute something that isn't wp, they could always pass the --entrypoint flag and run other tools in the container.
LGTM!
eb74a1a to
ba824ad
Compare
Part of #83421.
What?
Sets
entrypoint: wpon thecliandcli_e2e_testsservices indocker-compose.yml.Why?
The PHP and end-to-end jobs fail in
Install WordPress, before any test runs:Every script in
bin/passes WP-CLI subcommands straight to these services (docker-compose run --rm -u 33 cli core install ...) and relies on thewordpress:cliimage's entrypoint to prefix them withwp. The image's current entrypoint only does that whenwp help <command>succeeds:Before WordPress is installed,
wp help corefails with "The site you have requested is not installed", so the entrypoint runscoreas a program. The image's entrypoint used to run that check with--path=/dev/null, which never loaded WordPress; the published images were rebuilt without it, which is why this worked when the branch was current. The failure goes back to the first run of these workflows (desrosj#450 and desrosj#452).How?
With
entrypoint: wp, Docker Compose runs WP-CLI directly and passes the command as its arguments, whatever state the site is in. Every commandbin/install-wordpress.shandbin/setup-local-env.shsend to these services is a WP-CLI subcommand (core,db,option,plugin,post,user), so nothing else changes.There is no upstream fix to port:
trunkhad already replaced this Docker environment withwp-scripts envwhen the image changed.Testing Instructions
Reproduced with this branch's own
docker-compose.yml(wordpress:5.2/wordpress:cli-php7.3; the 5.1 images behave the same):run --rm -u 33 cli core install ...fails withcore: not found, andrun --rm -u 33 --entrypoint wp cli core install ...succeeds. With the change,bin/install-docker.shcompletes onwp/5.2(WordPress, the PHPUnit test suite and the Composer dependencies), andnpm run lint-php,npm run test-unit-phpandnpm run test-unit-php-multisiteall pass.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