Repository navigation
Drop roave/security-advisories in CI when it conflicts with the PHP in use - #305
Conversation
It conflicts with every PHP release below 8.2, so composer install can never succeed there. Composer's policy.advisories.block still applies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UWTd5mjnLFLCExqdULKVSB
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Workflow PHP compatibility handling .github/workflows/reusable-functional.yml, .github/workflows/reusable-unit.yml |
Both workflows enable the PHP setup update option on Windows. Before installing dependencies, they check the package’s PHP conflict constraints and remove roave/security-advisories with no dependency update when a constraint matches. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: schlessera
Merge Risk: 
Minimal · up to c7459
-
The workflows conditionally remove Roave for conflicting PHP versions and request Windows PHP updates. No merge-blocking issue was established.
Pre-merge checks: 
4
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- 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.
Comment @coderabbitai help to get the list of available commands.
Its PHP conflict covers patch releases of 8.3-8.5 too (e.g. Windows runners on PHP 8.5.11), not just < 8.2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UWTd5mjnLFLCExqdULKVSB
… use Read roave's php conflict constraint from Packagist and drop the package only when the running PHP falls inside it, so up-to-date PHP versions keep the dependency check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UWTd5mjnLFLCExqdULKVSB
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UWTd5mjnLFLCExqdULKVSB
There was a problem hiding this comment.
Copilot code review could not start because the generated Actions workflow failed validation. Check .github/workflows/copilot-code-review.yml (or .yaml) on your default branch, or copilot-setup-steps.yml (or .yaml) if the code review workflow is absent. Check action references and the placement of workflow settings. If the configuration is valid, or you have no setup workflow, contact GitHub Support.
Windows runners don't pick up patched setup-php builds automatically (shivammathur/setup-php#1139), so they lag a patch release behind and roave/security-advisories can't install there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UWTd5mjnLFLCExqdULKVSB
roave/security-advisoriesalso conflicts with PHP releases that have known advisories, currentlyphp <8.2.35 | >=8.3,<8.3.36 | >=8.4,<8.4.27 | >=8.5,<8.5.12(Roave/SecurityAdvisories#155).composer installtherefore fails on CI legs whose PHP is in that range, including old PHP versions and runners that lag a patch release (e.g. Windows on PHP 8.5.11; see wp-cli/wp-cli-tests run 40820389437).This changes
reusable-unit.ymlandreusable-functional.ymlto:update: truefor setup-php). Ubuntu and macOS runners pick up patched builds automatically, but Windows doesn't (PHP security releases shivammathur/setup-php#1139).roave/security-advisoriesinrequire-dev. It reads roave's currentphpconflict constraint from Packagist (composer show --available) and removes roave fromrequire-devonly if the running PHP version falls within that constraint.Up-to-date PHP versions keep roave, so it still flags other insecure dependencies. The step uses
php/composerrather thanjq, so it also runs on Windows and macOS.Ignoring the PHP conflict is safe on CI because setup-php ships builds with security fixes backported, even for EOL versions, so the version number alone overstates the risk (see shivammathur/setup-php#1139).
Verification (wp-cli/wp-cli-tests, run 40834001475 against this branch): all 60 jobs pass. Windows updates to PHP 8.5.12 and keeps roave, Ubuntu PHP 8.5 keeps roave, and PHP 7.4 drops it.
🤖 Generated with Claude Code
https://claude.ai/code/session_01UWTd5mjnLFLCExqdULKVSB