Skip to content

Repair wp/6.7 branch Actions: Fix Composer PHP platform value override breaking unit tests in older PHP versions - #122

Closed
desrosj wants to merge 1 commit into
fix-actions-6.7/ignore-browserslist-old-datafrom
fix-actions-6.7/fix-composer-platform-override
Closed

desrosj wants to merge 1 commit into
fix-actions-6.7/ignore-browserslist-old-datafrom
fix-actions-6.7/fix-composer-platform-override

Conversation

@desrosj

@desrosj desrosj commented Aug 28, 2026

Copy link
Copy Markdown
Owner

What?

Removes unit-test.yml's "Override PHP version in composer.json" step and composer.json's config.platform.php value, replacing them with an explicit require.php: ">=7.2.24" constraint.

Why?

The override step ran composer config platform.php ${{ matrix.php }}, setting platform.php to the bare version string for each matrix leg (e.g. 7.2). Composer normalizes a bare major.minor value to major.minor.0.0 for dependency resolution, which is below the >=7.2.5 minimum required by symfony/console and symfony/process (both pulled in by spatie/phpunit-watcher) — even though the actual PHP interpreter installed for that job (via shivammathur/setup-php) is a current 7.2.x patch release well above 7.2.5. This made the PHP 7.2 job in unit-test.yml fail outright with "Your requirements could not be resolved to an installable set of packages."

How?

This is a direct port of commit d2eb077a23068b93490a13bf1590f4d58d14ea2f ("Unit testing: Allow Composer to auto-detect PHP version", WordPress/gutenberg#73358), merged to trunk 2025-11-18 and already present on wp/6.9/wp/6.8. This branch's own minimum-PHP value (7.2, confirmed via gutenberg.php's Requires PHP header) and dependency graph were independently tested and produce the same >=7.2.24 floor trunk's fix used (the exact technical resolution floor is >=7.2.5; 7.2.24 matches the safety margin used on wp/6.8/wp/6.6). Verified locally by simulating dependency resolution for every one of this branch's PHP matrix legs (7.2, 7.3, 7.4, 8.0, 8.1, 8.2) with composer update --dry-run, using realistic patch versions for each — all resolve cleanly with this change applied.

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 removed this pull request from stack #90 September 10, 2026 19:33
@desrosj
desrosj force-pushed the fix-actions-6.7/fix-composer-platform-override branch from 1e84904 to a1822d4 Compare September 10, 2026 19:35
@desrosj
desrosj added this pull request to stack #185 September 10, 2026 19:36
@desrosj
desrosj force-pushed the fix-actions-6.7/fix-composer-platform-override branch from a1822d4 to a23ad34 Compare September 10, 2026 23:57
@desrosj
desrosj force-pushed the fix-actions-6.7/fix-composer-platform-override branch from a23ad34 to 87ce83e Compare September 11, 2026 00:28
@desrosj
desrosj force-pushed the fix-actions-6.7/fix-composer-platform-override branch from 87ce83e to 9ba02ff Compare September 11, 2026 01:14
@desrosj
desrosj force-pushed the fix-actions-6.7/fix-composer-platform-override branch from 9ba02ff to d9c87ab Compare September 11, 2026 02:19
@desrosj
desrosj marked this pull request as ready for review September 11, 2026 02:44
@desrosj
desrosj marked this pull request as draft September 11, 2026 03:22
@github-actions

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. You can also manually ask me to refresh this list by adding the props-bot label.

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>

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

@desrosj
desrosj force-pushed the fix-actions-6.7/fix-composer-platform-override branch from d9c87ab to 08ec647 Compare September 14, 2026 01:48
The "Override PHP version in composer.json" step in `unit-test.yml` set
Composer's `platform.php` config to the matrix's bare PHP version string
(e.g. `7.2`). Composer normalizes a bare major.minor value to `X.Y.0.0`
for dependency resolution, which falls below the `>=7.2.5` minimum
required by `symfony/console`/`symfony/process` (pulled in transitively
by `spatie/phpunit-watcher`). This caused `composer update` to fail with
"Your requirements could not be resolved to an installable set of
packages" for the PHP 7.2 matrix leg, even though the actual PHP
interpreter installed for that job via `shivammathur/setup-php` was a
legitimate `7.2.x` patch release that satisfied the requirement fine.

This branch's minimum supported PHP version, per `gutenberg.php`'s
`Requires PHP` header, is `7.2`. Instead of overriding `platform.php`
with an easy-to-underspecify bare version, remove `config.platform.php`
from `composer.json` entirely and add an explicit `require.php:
">=7.2.24"` constraint, so Composer resolves against whatever PHP is
genuinely running the job. The `>=7.2.24` floor was chosen so every
matrix leg (`7.2`, `7.3`, `7.4`, `8.0`, `8.1`, `8.2`) resolves cleanly.
@desrosj
desrosj force-pushed the fix-actions-6.7/fix-composer-platform-override branch from 08ec647 to 55b3235 Compare September 14, 2026 19:10
@desrosj
desrosj marked this pull request as ready for review September 14, 2026 19:29
@desrosj
desrosj marked this pull request as draft September 14, 2026 19:31
@desrosj
desrosj marked this pull request as ready for review September 14, 2026 19:38
@desrosj

desrosj commented Sep 15, 2026

Copy link
Copy Markdown
Owner Author

Migrated to real upstream: WordPress#82902. Closing this fork PR.

@desrosj desrosj closed this Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant