Repository navigation
Closes #1303: unblock composer install on PHP 7.4/8.0/8.1 CI jobs - #1304
Conversation
roave/security-advisories now conflicts with php <8.2.35 (and older 8.3/8.4/8.5 patches), so Composer cannot resolve dependencies on PHP 7.4, 8.0 or 8.1. Upstream says this is intentional, and those branches will never get a release outside the range. Remove the package from require-dev in CI on those versions only, before setup-php-composer runs. The committed composer.json, the PHP 8.2+ jobs and the Strauss post-install scripts are unchanged. Composer 2.9+ still blocks package versions with known advisories during update on the old-PHP jobs. Refs #1303 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Coverage variation | Report missing for 34da2131 |
| Diff coverage | ✅ ∅ diff coverage (50.00%) |
Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (34da213) Report Missing Report Missing Report Missing Head commit (44234e8) 20546 1653 8.05% Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>
Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#1304) 0 0 ∅ (not applicable) Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Description
Closes #1303
The PHP 7.4, 8.0 and 8.1 CI jobs fail at
composer installon every PR, becauseroave/security-advisoriesnow conflicts withphp <8.2.35|>=8.3,<8.3.36|…. This is CI-only: there is no change for plugin users, and the released ZIP is built with--no-dev.Before
setup-php-composerruns, a new step removesroave/security-advisoriesfromrequire-devon PHP 7.4/8.0/8.1 only. The committedcomposer.jsonstays the same.Type of change
Detailed scenario
What was tested
composer update --dry-runfails with the same roave conflict on the currentcomposer.json. After the step'sjqedit, it resolves (62 packages, phpunit 9.6.38).if:andrun:.Setup PHP + Composer, Strauss included, and the 8.2+ jobs should be unaffected.How to test
Check that
WP 5.9 with PHP 7.4,WP latest with PHP 8.0,WP latest with PHP 8.1andCode Coverage.passSetup PHP + Composerand run their test suites. In the 8.2+ jobs, theDrop roave/security-advisories…step should show as skipped.Affected Features & Quality Assurance Scope
CI only:
test.yml,test_legacy.yml,code_coverage.yml. No plugin code changed.Technical description
Documentation
Roave now lists advisories for PHP itself in its
conflictsection. Upstream says this is intentional (Roave/SecurityAdvisories#155). PHP 7.4, 8.0 and 8.1 are end of life and will never ship a version outside the range, so the conflict on them is permanent.Options considered:
--ignore-platform-req=phpconfig.platform.phpcomposer.jsonentirelyThe step runs before the shared
wp-media/workflowssetup-php-composeraction, because that action sets up PHP and installs dependencies in one go, with no hook in between. It usesjq, which is preinstalled on GitHub runners, because PHP and Composer don't exist yet at that point.composer-options: ''is unchanged, so the post-install/update scripts (Strauss prefixing) still run.New dependencies
None.
Risks
composer updateby itself (policy.advisories.block, on by default), so only roave's PHP-runtime conflict is lost on those jobs.composer update. That is out of scope here. Removing roave altogether in favour of Composer's native blocking could be a follow-up.if:must be updated if the matrix adds another end-of-life version.Mandatory Checklist
Code validation
Code style
Unticked items justification
There are no built-in tests: this is a CI workflow change, and the CI run on this PR is its test. The acceptance criteria are confirmed by that run (see "How to test").
Additional Checks
🤖 Generated with Claude Code