Repository navigation
Fix failing analysis, PHPUnit and JS unit test CI - #3721
Conversation
- mago analyze: declare symbols the analysis jobs cannot see (Pro classes, newer WP functions, WPDieException, PHPUnit attributes/exceptions) and tighten test type hints. - phpstan: cast the frm_builder_preview_in_browser filter result to bool; drop a redundant string cast. - php-cs-fixer: normalize docblock type order in RemoveUselessParenthesesSniff. - oxlint: move the microtask wait loops in paypalBootstrap.test.mjs into a helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| PHP | Nov 17, 2026 7:10p.m. | Review ↗ | |
| JavaScript | Nov 17, 2026 7:10p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
- phpunit.yml: the ubuntu-26.04 runner no longer ships MySQL, so /etc/init.d/mysql is missing. Run MySQL as a service container and point wp-tests-config at 127.0.0.1, matching Pro's workflow. - js-unit-tests.yml: two tests import @babel/core, so install dev dependencies before running node --test (same steps as jscs.yml). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Approve. Every change is test, stub, docblock or workflow config; the two runtime lines are type-only and behavior-neutral. One non-blocking note below.
Tests run (CI skipped every job at this head, so none of these ran there):
node --test tests/js/*.test.mjsafternpm ci --include=dev --legacy-peer-depsat f107c9e → 64/64 pass (includes the two@babel/coretests the workflow change is for).oxlint tests/js→ 0 warnings, 0 errors.- PHPUnit in the wordpress-develop harness (PHP 8.2, MariaDB) at f107c9e →
test_FrmFieldAddress52/52,test_FrmFieldCombo5/5,test_FrmFieldsController14/14. mago analyze→ 0 errors (32 warnings, all in files this PR does not touch);phpstan analyze ./→[OK] No errors.test_FrmAddon.php(docblock-only change) errors 25/25 in this harness with a PHPUnit mock-generation syntax error, identically with master's copy of the file, so it is the harness, not the PR. Not verified here.- Browser/visual check: not exercised (no UI surface in this diff).
- Not run: php-cs-fixer (the harness vendor tree does not load on this PHP), phpcs (config scan unusable here), psalm, rector.
Non-blocking (workflow, cannot be run here): the PHPUnit and JS workflow edits have not run on this head. The MySQL service block matches formidable-pro's phpunit.yml (same image, env, ports, health options), which had a green run today, but Pro's matrix starts at PHP 8.1. Lite also runs PHP 7.4 and 8.0 against mysql:8.4 (caching_sha2_password only), so add the run tests label and confirm those two jobs connect before merging.
Checked: include_boosts() drops (string) safely ($cache_key is declared '' and set_cache_key() always assigns a string); (bool) on frm_builder_preview_in_browser only changes the return for a non-bool filter value, which the docblock already declares as bool. No suppressions or baseline entries added. Workflow diff does not add cost (no new matrix rows, one service container, npm ci is cache-gated).
Brings master back to green. Each of these was failing on a clean checkout of
master(310cf1d):analyze)FrmProFieldText,FrmProCopy::install(),wp_unregister_ability_category(),did_filter()(newer than the pinned 5.9 stubs),WPDieException, and the PHPUnitRunInSeparateProcess/PreserveGlobalState/ExpectationFailedException(mago's job doesn't install PHPUnit). Tighten a few test type hints.frm_builder_preview_in_browserfilter result tobool; drop a redundant(string)cast inFrmFormApi::include_boosts().RemoveUselessParenthesesSniff.paypalBootstrap.test.mjsinto a helper./etc/init.d/mysql: command not found)wp-tests-config.phpat127.0.0.1— same setup Pro'sphpunit.ymlalready uses.Cannot find package '@babel/core'@babel/core; install dev dependencies first (same cache +npm cisteps asjscs.yml).No suppressions or baseline entries were added. Every new stub is referenced by code on master.
Verified locally on this branch: mago lint/analyze, phpstan, php-cs-fixer, rector, phpcs, oxlint, typos, JS unit tests all exit 0. PHPUnit and psalm passed locally with the same code changes applied.
🤖 Generated with Claude Code