Skip to content

Repair wp/5.2 branch Actions: Run WP-CLI directly in the cli containers - #85653

Merged
desrosj merged 1 commit into
fix-actions-5.2/ignore-browserslist-old-datafrom
fix-actions-5.2/run-wp-cli-directly
Oct 29, 2026
Merged

desrosj merged 1 commit into
fix-actions-5.2/ignore-browserslist-old-datafrom
fix-actions-5.2/run-wp-cli-directly

Conversation

@desrosj

@desrosj desrosj commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Part of #83421.

What?

Sets entrypoint: wp on the cli and cli_e2e_tests services in docker-compose.yml.

Why?

The PHP and end-to-end jobs fail in Install WordPress, before any test runs:

/usr/local/bin/docker-entrypoint.sh: exec: line 11: core: not found

Every script in bin/ passes WP-CLI subcommands straight to these services (docker-compose run --rm -u 33 cli core install ...) and relies on the wordpress:cli image's entrypoint to prefix them with wp. The image's current entrypoint only does that when wp help <command> succeeds:

if [ "${1#-}" != "$1" ] || wp help "$1" > /dev/null 2>&1; then
	set -- wp "$@"
fi
exec "$@"

Before WordPress is installed, wp help core fails with "The site you have requested is not installed", so the entrypoint runs core as 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 command bin/install-wordpress.sh and bin/setup-local-env.sh send 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: trunk had already replaced this Docker environment with wp-scripts env when 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 with core: not found, and run --rm -u 33 --entrypoint wp cli core install ... succeeds. With the change, bin/install-docker.sh completes on wp/5.2 (WordPress, the PHPUnit test suite and the Composer dependencies), and npm run lint-php, npm run test-unit-php and npm run test-unit-php-multisite all 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

@desrosj desrosj added the [Type] Build Tooling Issues or PRs related to build tooling label Oct 26, 2026
@desrosj desrosj self-assigned this Oct 26, 2026
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 79565ca2-b144-4b10-a6c0-533c1a7e4c60

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 27, 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.

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>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@andrewserong andrewserong left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

@desrosj
desrosj force-pushed the fix-actions-5.2/run-wp-cli-directly branch from eb74a1a to ba824ad Compare October 29, 2026 12:48
@desrosj
desrosj merged commit 300ba2b into wp/5.2 Oct 29, 2026
15 of 25 checks passed
@desrosj
desrosj deleted the fix-actions-5.2/run-wp-cli-directly branch October 29, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants