Skip to content

Repair wp/6.0 branch Actions: Resolve Composer dependencies against the lowest tested PHP version - #633

Closed
desrosj wants to merge 1 commit into
fix-actions-6.0/fix-phpunit-dev-dependency-floorfrom
fix-actions-6.0/fix-composer-platform-override
Closed

desrosj wants to merge 1 commit into
fix-actions-6.0/fix-phpunit-dev-dependency-floorfrom
fix-actions-6.0/fix-composer-platform-override

Conversation

@desrosj

@desrosj desrosj commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

What?

Makes Composer resolve this branch's dependencies against PHP 5.6.20, the lowest PHP version the unit-test matrix runs and WordPress's minimum PHP version for this release:

  • Changes composer.json's config.platform.php from 7.4 to 5.6.20.
  • Adds "php": ">=5.6.20" to require.
  • Regenerates composer.lock with composer update phpunit/phpunit --with-all-dependencies. The only package changes are:
    • 9 downgrades:
      • symfony/yaml v4.4.45 → v3.4.47
      • doctrine/instantiator 1.5.0 → 1.0.5
      • myclabs/deep-copy 1.13.4 → 1.7.0
      • phpdocumentor/reflection-common 2.2.0 → 1.0.1
      • phpdocumentor/reflection-docblock 5.6.7 → 3.3.2
      • phpdocumentor/type-resolver 1.12.0 → 0.4.0
      • phpunit/php-token-stream 2.0.2 → 1.4.12
      • symfony/polyfill-ctype v1.37.0 → v1.19.0
      • webmozart/assert 1.12.1 → 1.9.1
    • 2 removals:
      • doctrine/deprecations
      • phpstan/phpdoc-parser

This is the wp/6.0 counterpart of #441 (wp/6.1) and #512 (wp/6.2).

Why?

With the platform set to 7.4, Composer installs symfony/yaml 4.4, which requires PHP 7.1. The PHP 7.0 jobs run the PHPUnit 6.5 phar from the wp-env image, and the plugin's Composer autoloader is registered in front of the phar's own. When PHPUnit prints a failure diff, it loads Symfony\Component\Yaml\Yaml from the plugin's vendor directory, and PHP 7.0 cannot parse it. Every failing assertion then becomes a fatal error, as in the PHP 7.0 job of run 37374660162:

Fatal error: Method PHPUnit\Framework\ExpectationFailedException::__toString() must not throw an exception, caught ParseError: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE) in phar:///usr/local/bin/phpunit/phpunit/TextUI/ResultPrinter.php on line 0

Resolving against 5.6.20 picks versions that every job in the matrix can load.

How?

#441 and #512 remove config.platform.php entirely and let Composer detect the running PHP version. That doesn't work here. Those branches have no composer.lock and run composer install on the runner at the job's own PHP version. This branch commits a composer.lock and installs inside wp-env's composer container, which runs PHP 8.5. Without a platform value, composer install would check the lock against PHP 8.5 and reject it, because PHPUnit 5.7 and its dependencies don't allow PHP 8. So this branch keeps config.platform.php, sets it to the lowest PHP version the tests run under, and adds the same require.php floor as the other branches.

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 this pull request to stack #634 October 6, 2026 17:56
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

🤖 PR meta 🤖

🏷️ Labels

This pull request needs exactly one label indicating its type, and has 0.

  • Required: any label starting with [Type].
  • Found: none.

Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you.

@desrosj
desrosj removed this pull request from stack #634 October 7, 2026 18:02
@desrosj
desrosj changed the base branch from fix-actions-6.0/fix-phpunit-dev-dependency-floor to wp/6.0 October 7, 2026 18:02
@desrosj
desrosj force-pushed the fix-actions-6.0/fix-composer-platform-override branch from 5b9ee37 to 777226e Compare October 7, 2026 18:04
@desrosj
desrosj changed the base branch from wp/6.0 to fix-actions-6.0/fix-phpunit-dev-dependency-floor October 7, 2026 18:06
@desrosj
desrosj added this pull request to stack #669 October 7, 2026 18:06
@desrosj
desrosj marked this pull request as ready for review October 8, 2026 04:23
@github-actions

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

Copy link
Copy Markdown
Owner Author

Moved to WordPress#84282.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant