Skip to content

Repair wp/5.5 branch Actions: Add a WP_ENV_PHP_VERSION environment variable - #85012

Merged
desrosj merged 1 commit into
fix-actions-5.5/pin-mariadb-versionfrom
fix-actions-5.5/pin-wordpress-images-to-php-7-4
Oct 27, 2026
Merged

desrosj merged 1 commit into
fix-actions-5.5/pin-mariadb-versionfrom
fix-actions-5.5/pin-wordpress-images-to-php-7-4

Conversation

@desrosj

@desrosj desrosj commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Part of #82938.

What?

Adds a WP_ENV_PHP_VERSION environment variable that chooses the PHP version of wp-env's WordPress and WP-CLI containers, and defaults it to 7.4, the highest PHP version WordPress 5.5 supports. In packages/env/lib/build-docker-compose-config.js:

Services Before After
wordpress, tests-wordpress wordpress wordpress:php${WP_ENV_PHP_VERSION:-7.4}
cli, tests-cli wordpress:cli wordpress:cli-php${WP_ENV_PHP_VERSION:-7.4}

Adds a test for the image strings, a README note next to the WP_ENV_MARIADB_VERSION one, and a packages/env/CHANGELOG.md entry under New Features. The phpunit service is unchanged: it already uses LOCAL_PHP, which the PHP job's matrix sets.

Why?

The floating wordpress image now runs PHP 8.3, but WordPress 5.5 doesn't support PHP 8. On PHP 8, WordPress 5.5's WP_Query::parse_query() makes every front-end request without a post ID a 404: it checks $qv['p'] < 0 without casting, and PHP 8 compares '' with 0 as strings, which is true. WordPress 5.6 casts the value to an integer first.

That breaks every end-to-end test that loads the site editor's front-page demo template: the front page is a 404, so Gutenberg resolves index instead, and front-page and its header template part never load. 10 tests fail on this branch for that reason (experiments/multi-entity-editing.test.js 5, multi-entity-saving.test.js 4, template-part.test.js 1).

Defaulting to 7.4, rather than the images' default, means anyone running this branch's wp-env gets a PHP version WordPress 5.5 supports without setting anything. CI sets the variable explicitly in #85013.

How?

This follows WP_ENV_MARIADB_VERSION (#85008), and the variable name matches the one later wp-env versions use. wp-env 1.6.0 has no phpVersion option to extend, so only the environment variable is added; Docker Compose fills it in when it reads the generated docker-compose.yml. Both image families have a php<version> / cli-php<version> tag for each PHP version, so one default covers both.

Verified:

  • The new test passes, with the rest of packages/env/test/build-docker-compose-config.js (14 tests).
  • docker compose config on this branch's generated file resolves wordpress:php7.4 / wordpress:cli-php7.4 with the variable unset, and wordpress:php7.3 / wordpress:cli-php7.3 with WP_ENV_PHP_VERSION=7.3. All four tags exist on Docker Hub.
  • An earlier version of this PR that hardcoded the same 7.4 images passed every check, including all four Admin jobs.

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.

@desrosj desrosj added [Type] Build Tooling Issues or PRs related to build tooling [Tool] Env /packages/env labels Oct 16, 2026
@desrosj desrosj self-assigned this Oct 16, 2026
@coderabbitai

coderabbitai Bot commented Oct 16, 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: 0c1601b0-ef06-47ea-815f-dccb29892f19

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.

@desrosj
desrosj added this pull request to stack #85017 October 16, 2026 20:10
@github-actions

Copy link
Copy Markdown

Size Change: 0 B

Total Size: 1.14 MB

ℹ️ View Unchanged
Filename Size
build/a11y/index.js 1.14 kB
build/annotations/index.js 3.65 kB
build/api-fetch/index.js 3.38 kB
build/autop/index.js 2.84 kB
build/blob/index.js 623 B
build/block-directory/index.js 7.93 kB
build/block-directory/style-rtl.css 933 B
build/block-directory/style.css 933 B
build/block-editor/index.js 120 kB
build/block-editor/style-rtl.css 10.7 kB
build/block-editor/style.css 10.7 kB
build/block-library/editor-rtl.css 7.59 kB
build/block-library/editor.css 7.59 kB
build/block-library/index.js 130 kB
build/block-library/style-rtl.css 7.76 kB
build/block-library/style.css 7.77 kB
build/block-library/theme-rtl.css 723 B
build/block-library/theme.css 724 B
build/block-serialization-default-parser/index.js 1.88 kB
build/block-serialization-spec-parser/index.js 3.1 kB
build/blocks/index.js 48.3 kB
build/components/index.js 198 kB
build/components/style-rtl.css 15.9 kB
build/components/style.css 15.8 kB
build/compose/index.js 9.67 kB
build/core-data/index.js 11.4 kB
build/data-controls/index.js 1.29 kB
build/data/index.js 8.42 kB
build/date/index.js 5.4 kB
build/deprecated/index.js 774 B
build/dom-ready/index.js 569 B
build/dom/index.js 3.36 kB
build/edit-navigation/index.js 9.9 kB
build/edit-navigation/style-rtl.css 1.06 kB
build/edit-navigation/style.css 1.06 kB
build/edit-post/index.js 304 kB
build/edit-post/style-rtl.css 5.57 kB
build/edit-post/style.css 5.56 kB
build/edit-site/index.js 16.7 kB
build/edit-site/style-rtl.css 3 kB
build/edit-site/style.css 3 kB
build/edit-widgets/index.js 9.4 kB
build/edit-widgets/style-rtl.css 2.43 kB
build/edit-widgets/style.css 2.43 kB
build/editor/editor-styles-rtl.css 537 B
build/editor/editor-styles.css 539 B
build/editor/index.js 45.2 kB
build/editor/style-rtl.css 3.78 kB
build/editor/style.css 3.78 kB
build/element/index.js 4.64 kB
build/escape-html/index.js 734 B
build/format-library/index.js 7.74 kB
build/format-library/style-rtl.css 548 B
build/format-library/style.css 549 B
build/hooks/index.js 2.13 kB
build/html-entities/index.js 623 B
build/i18n/index.js 3.57 kB
build/is-shallow-equal/index.js 713 B
build/keyboard-shortcuts/index.js 2.5 kB
build/keycodes/index.js 1.93 kB
build/list-reusable-blocks/index.js 3.11 kB
build/list-reusable-blocks/style-rtl.css 473 B
build/list-reusable-blocks/style.css 473 B
build/media-utils/index.js 5.3 kB
build/notices/index.js 1.78 kB
build/nux/index.js 3.38 kB
build/nux/style-rtl.css 672 B
build/nux/style.css 669 B
build/plugins/index.js 2.56 kB
build/primitives/index.js 1.39 kB
build/priority-queue/index.js 788 B
build/redux-routine/index.js 2.84 kB
build/rich-text/index.js 14.1 kB
build/server-side-render/index.js 2.7 kB
build/shortcode/index.js 1.71 kB
build/token-list/index.js 1.27 kB
build/url/index.js 4.07 kB
build/viewport/index.js 1.83 kB
build/warning/index.js 1.13 kB
build/wordcount/index.js 1.18 kB

compressed-size-action

@github-actions

github-actions Bot commented Oct 19, 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: ramonjd <ramonopoly@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.

This was referenced Oct 21, 2026
@desrosj
desrosj force-pushed the fix-actions-5.5/pin-wordpress-images-to-php-7-4 branch from f3b044c to b02a1af Compare October 23, 2026 14:12
@desrosj
desrosj force-pushed the fix-actions-5.5/pin-wordpress-images-to-php-7-4 branch from b02a1af to 9ec018b Compare October 26, 2026 00:20
@desrosj desrosj added the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Oct 26, 2026
@github-actions github-actions Bot removed the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Oct 26, 2026
@desrosj
desrosj removed this pull request from stack #85017 October 26, 2026 19:34
@desrosj
desrosj added this pull request to stack #85591 October 26, 2026 19:35
@desrosj
desrosj merged commit fb1238b into wp/5.5 Oct 27, 2026
30 of 47 checks passed
@desrosj
desrosj deleted the fix-actions-5.5/pin-wordpress-images-to-php-7-4 branch October 27, 2026 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Tool] Env /packages/env [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