CI: modernize composer/checkout actions, harden test workflows, fix core cron REQUEST_URI notice - #8691
Merged
Merged
Conversation
…_URI notice in tests - Bump actions/checkout to v7 (Node 24) across the PHP test workflows and deploy_plugin. - Replace the custom "get composer cache dir + actions/cache + composer install" steps with ramsey/composer-install@v4 (wraps actions/cache@v5 on Node 24), keeping --no-scripts so Mozart/dump-autoload/text-domain scripts stay disabled in CI. This removes both the deprecated set-output command and the Node 20 cache action. - Seed a default $_SERVER['REQUEST_URI'] in the integration bootstrap. WordPress core's _wp_cron() reads it unguarded on shutdown when cron events are due (surfacing in the Cloudflare group), which under the PHPUnit CLI has no request and emits an "Undefined array key REQUEST_URI" warning. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…fast, timeout) - Add a concurrency group so superseded PR runs are cancelled, matching the convention already used by the lint workflows. - Declare top-level permissions: contents: read (least privilege); the coverage job authenticates to Codacy with its own project-token secret, unaffected. - Set fail-fast: false so one failing PHP/WP matrix leg no longer cancels the others, preserving the full compatibility picture. - Add timeout-minutes: 30 to guard against hung jobs running to the default limit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Coverage variation | ✅ +0.00% coverage variation (-0.10%) |
| Diff coverage | ✅ ∅ diff coverage (50.00%) |
Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (3fb7260) 46709 22513 48.20% Head commit (cde73df) 46709 (+0) 22513 (+0) 48.20% (+0.00%) 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 (#8691) 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%
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.
WordPress 6.9 moved _wp_cron() to the shutdown action (wp-includes/cron.php), where it reads $_SERVER['REQUEST_URI'] unguarded when spawning due cron events. Under the PHPUnit CLI there is no request, so this emits an "Undefined array key REQUEST_URI" warning at process shutdown. Seeding the value at the top of the bootstrap did not survive the WP test suite's own $_SERVER setup, so register a shutdown callback at priority 0 (ahead of _wp_cron at 10) that ensures the key exists just before core reads it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
4 tasks
remyperona
marked this pull request as ready for review
August 10, 2026 19:01
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes n/a
Modernizes the PHP test and deploy GitHub Actions workflows and clears the warnings they currently emit. No plugin runtime code is changed — the only non-workflow edit is a test-bootstrap default.
actions/checkouttov7(Node 24) across the PHP test workflows anddeploy_plugin.actions/cache+composer install" boilerplate withramsey/composer-install@v4(wrapsactions/cache@v5on Node 24), keeping--no-scriptsso Mozart / dump-autoload / text-domain scripts stay disabled in CI. This removes both the deprecatedset-outputcommand and the Node 20 action warnings.$_SERVER['REQUEST_URI']on theshutdownhook in the integration bootstrap. Since WordPress 6.9, core's_wp_cron()runs onshutdown(wp-includes/cron.php) and reads$_SERVER['REQUEST_URI']unguarded when spawning due cron events; under the PHPUnit CLI there is no request, so it emitted an "Undefined array key REQUEST_URI" notice at process shutdown.concurrencygroup (matching the lint workflows), declare least-privilegepermissions: contents: read, setfail-fast: falseso one matrix leg no longer cancels the others, and addtimeout-minutes: 30.Type of change
Detailed scenario
What was tested
This PR's own GitHub Actions runs, verifying: (1) no Node 20 or
set-outputdeprecation warnings remain in the PHP test workflows, (2) Composer dependencies install viaramsey/composer-installwith--no-scripts(Mozart not re-run), and (3) the "Undefined array key REQUEST_URI" notice no longer appears at the start of the Cloudflare integration group.How to test
Open this PR's Actions tab and inspect the four PHP test workflow runs — confirm they are green, the deprecation annotations are gone, and the Cloudflare integration group log no longer contains the
REQUEST_URIwarning.Affected Features & Quality Assurance Scope
CI/tooling only. No plugin runtime behavior changes. The single non-workflow change is a test-only default for
$_SERVER['REQUEST_URI']intests/Integration/bootstrap.php.Technical description
The composer cache directory step used the deprecated
::set-outputcommand and the cache/checkout steps ran on the retiring Node 20 runtime.ramsey/composer-install@v4replaces the three-step pattern with a single maintained action (Node 24 viaactions/cache@v5);--no-scriptspreserves the current behavior of not re-running Mozart in CI. Withcomposer.lockgitignored, the action's defaultlockedmode resolves like the previouscomposer install.The
REQUEST_URInotice originates in WordPress core (wp-includes/cron.php,_wp_cron()), not in the plugin — all first-party reads are already guarded. WordPress 6.9 moved_wp_cron()to theshutdownaction (default priority 10). Seeding the value at the top of the bootstrap did not survive the WP test suite's own$_SERVERsetup, so the fix registers ashutdowncallback at priority 0 (ahead of_wp_cron) that ensures the key exists just before core reads it. Test-only and production-safe.Documentation
n/a
New dependencies
ramsey/composer-installGitHub Action (CI only; not a plugin/runtime dependency).Risks
CI/tooling-only change. Worst case is a workflow misconfiguration, which surfaces immediately in this PR's own runs rather than affecting the shipped plugin.
Mandatory Checklist
Code validation
Code style
Unticked items justification
Built-in tests are not applicable: the change is GitHub Actions workflow configuration plus a test-only bootstrap default. The workflows are exercised directly by this PR's own CI runs.