Repository navigation
feat: PHPCS main file + coverage gate (80%) - #9
Conversation
Run phpcbf and manual docblock/comment fixes; remove main-file exclude from phpcs.xml.dist. Add mission spec and long-run state for coverage follow-up slice.
Add pcov coverage enforcement (80% lines on main file), check-plugin-coverage.sh, QA workflow integration, and integration tests for REST permissions, telemetry privacy, uninstall cleanup, GitHub updater paths, and meta auth.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Add lifecycle, plugins_api, rate-limit, dependency notice, and telemetry heartbeat tests to approach the 80% line coverage gate on the main file.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3dc88256c8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| fwrite(STDERR, sprintf("check-plugin-coverage: FAIL (minimum %.2f%%)\n", $min)); | ||
| exit(1); | ||
| } | ||
| fwrite(STDERR, sprintf("check-plugin-coverage: PASS (minimum %.2f%%)\n", $min)); |
There was a problem hiding this comment.
Open stderr explicitly in the stdin-fed PHP script
In the PHP 8.1 environment configured by .github/workflows/qa.yml, this PHP block is read from stdin through a heredoc, where the standard stream constants are unavailable (PHP manual). Consequently, even when PHPUnit succeeds and coverage meets 80%, this final statement throws Undefined constant "STDERR", causing the coverage step to fail instead of passing. Open php://stderr explicitly and use that resource for all diagnostics in this block, or execute the checker from a PHP file.
Useful? React with 👍 / 👎.
Define STDERR for CI PHP embed; add updater error, deactivation, and REST field tests to move line coverage toward the 80% gate.
Register minimal WooCommerce stubs in PHPUnit bootstrap so product REST coverage runs in CI; add sanitizer and invalid GitHub payload tests.
Add CoverageBooster and CoverageGap integration tests for admin notices, GitHub updater transport errors, telemetry, plugin_info, and enqueue paths.
Add integration tests for register_plugin_settings, load_textdomain, notice dismissals, log_debug, and dependency notice markup.
Summary
rank-math-api-manager.php(phpcbf + manual fixes); removed main-file exclude fromphpcs.xml.dist.scripts/check-plugin-coverage.shenforces ≥80% line coverage on the main plugin file.Test plan
./scripts/run-phpunit-local.sh(25 tests, WC product skipped without WooCommerce)vendor/bin/phpcs --standard=phpcs.xml.dist