Skip to content

Remove the Rust parser extension and its documentation - #566

Merged
adamziel merged 1 commit into
trunkfrom
codex/remove-rust-extension
Oct 23, 2026
Merged

adamziel merged 1 commit into
trunkfrom
codex/remove-rust-extension

Conversation

@adamziel

@adamziel adamziel commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Removes the Rust MySQL lexer/parser package, its PHP bridge, native-only tests and benchmarks, CI jobs, WASM publishing, and docs.

The driver and benchmarks now always use PHP. Parser reuse, parser type/AST checks, and the PHP 7.2–8.5/SQLite CI matrix remain.

Testing

  • MySQL-on-SQLite: 1,141 tests, 1,430,839 assertions; 3 skipped, 2 incomplete.
  • Coding standards, PHP syntax checks, workflow validation, benchmark smoke tests, and plugin ZIP build pass.
  • WordPress Docker tests left to CI.

Summary by CodeRabbit

  • Changes
    • MySQL parsing in the SQLite driver now consistently uses the PHP implementation.
    • The optional native PHP parser extension and its WebAssembly builds are no longer available.
    • Lexer and parser benchmarks now report results for the PHP implementation only.
  • Tests
    • Parser tests continue to check compatibility with the shared parser interface and confirm that parsing produces an abstract syntax tree.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 15b84641-1280-42be-9fba-2687021b0dc1
📥 Commits

Reviewing files that changed from the base of the PR and between 87b8905 and 47ed720.

⛔ Files ignored due to path filters: 1
  • packages/php-ext-wp-mysql-parser/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing: 41
  • .github/workflows/phpunit-tests.yml
  • .github/workflows/publish-wasm-extension-artifact.yml
  • .github/workflows/wasm-spike.yml
  • .github/workflows/wp-tests-phpunit-native-extension-setup.sh
  • .github/workflows/wp-tests-phpunit-run.js
  • .github/workflows/wp-tests-phpunit.yml
  • .gitignore
  • README.md
  • packages/mysql-on-sqlite/src/load.php
  • packages/mysql-on-sqlite/src/mysql/native/class-wp-mysql-lexer.php
  • packages/mysql-on-sqlite/src/mysql/native/class-wp-mysql-native-parser-node.php
  • packages/mysql-on-sqlite/src/mysql/native/class-wp-mysql-parser.php
  • packages/mysql-on-sqlite/src/mysql/native/mysql-rust-bridge.php
  • packages/mysql-on-sqlite/src/mysql/native/trait-wp-mysql-native-parser-impl.php
  • packages/mysql-on-sqlite/src/parser/class-wp-parser-grammar.php
  • packages/mysql-on-sqlite/src/sqlite/class-wp-mysql-on-sqlite.php
  • packages/mysql-on-sqlite/tests/bootstrap.php
  • packages/mysql-on-sqlite/tests/mysql/WP_MySQL_Parser_Instanceof_Tests.php
  • packages/mysql-on-sqlite/tests/mysql/native/WP_MySQL_Native_Parser_Node_Cycle_Tests.php
  • packages/mysql-on-sqlite/tests/mysql/native/WP_MySQL_Native_Parser_Node_Identity_Tests.php
  • packages/mysql-on-sqlite/tests/mysql/native/WP_MySQL_Parser_Instanceof_Tests.php
  • packages/mysql-on-sqlite/tests/tools/run-lexer-benchmark.php
  • packages/mysql-on-sqlite/tests/tools/run-native-extension-benchmark.php
  • packages/mysql-on-sqlite/tests/tools/run-parser-benchmark.php
  • packages/mysql-on-sqlite/tests/tools/verify-native-parser-extension.php
  • packages/php-ext-wp-mysql-parser/.gitignore
  • packages/php-ext-wp-mysql-parser/Cargo.toml
  • packages/php-ext-wp-mysql-parser/README.md
  • packages/php-ext-wp-mysql-parser/src/lexer_constants.rs
  • packages/php-ext-wp-mysql-parser/src/lib.rs
  • packages/php-ext-wp-mysql-parser/tools/generate-lexer-constants.php
  • packages/php-ext-wp-mysql-parser/wasm-spike/.gitignore
  • packages/php-ext-wp-mysql-parser/wasm-spike/Dockerfile.rust
  • packages/php-ext-wp-mysql-parser/wasm-spike/RESULT.md
  • packages/php-ext-wp-mysql-parser/wasm-spike/build-in-docker-rust.sh
  • packages/php-ext-wp-mysql-parser/wasm-spike/check-playground-web-compat.mjs
  • packages/php-ext-wp-mysql-parser/wasm-spike/probe-host-cargo-wasm.sh
  • packages/php-ext-wp-mysql-parser/wasm-spike/run-spike.mjs
  • packages/php-ext-wp-mysql-parser/wasm-spike/shim/config.m4
  • packages/php-ext-wp-mysql-parser/wasm-spike/shim/wp_mysql_parser_shim.c
  • packages/php-ext-wp-mysql-parser/wasm-spike/write-extension-manifest.mjs
💤 Files with no reviewable changes: 34
  • .gitignore
  • .github/workflows/wp-tests-phpunit.yml
  • packages/mysql-on-sqlite/src/mysql/native/class-wp-mysql-lexer.php
  • packages/php-ext-wp-mysql-parser/.gitignore
  • packages/php-ext-wp-mysql-parser/Cargo.toml
  • packages/php-ext-wp-mysql-parser/wasm-spike/.gitignore
  • .github/workflows/wasm-spike.yml
  • .github/workflows/wp-tests-phpunit-native-extension-setup.sh
  • packages/mysql-on-sqlite/tests/mysql/native/WP_MySQL_Native_Parser_Node_Identity_Tests.php
  • packages/php-ext-wp-mysql-parser/wasm-spike/shim/config.m4
  • packages/php-ext-wp-mysql-parser/wasm-spike/probe-host-cargo-wasm.sh
  • packages/php-ext-wp-mysql-parser/tools/generate-lexer-constants.php
  • packages/php-ext-wp-mysql-parser/wasm-spike/run-spike.mjs
  • packages/mysql-on-sqlite/tests/tools/verify-native-parser-extension.php
  • packages/mysql-on-sqlite/tests/tools/run-native-extension-benchmark.php
  • packages/mysql-on-sqlite/tests/bootstrap.php
  • packages/mysql-on-sqlite/src/parser/class-wp-parser-grammar.php
  • .github/workflows/publish-wasm-extension-artifact.yml
  • packages/php-ext-wp-mysql-parser/wasm-spike/check-playground-web-compat.mjs
  • packages/php-ext-wp-mysql-parser/wasm-spike/RESULT.md
  • packages/mysql-on-sqlite/src/mysql/native/class-wp-mysql-parser.php
  • packages/mysql-on-sqlite/tests/mysql/native/WP_MySQL_Native_Parser_Node_Cycle_Tests.php
  • packages/php-ext-wp-mysql-parser/wasm-spike/write-extension-manifest.mjs
  • packages/php-ext-wp-mysql-parser/README.md
  • packages/mysql-on-sqlite/src/mysql/native/trait-wp-mysql-native-parser-impl.php
  • packages/php-ext-wp-mysql-parser/wasm-spike/build-in-docker-rust.sh
  • .github/workflows/wp-tests-phpunit-run.js
  • packages/mysql-on-sqlite/tests/mysql/native/WP_MySQL_Parser_Instanceof_Tests.php
  • packages/php-ext-wp-mysql-parser/wasm-spike/shim/wp_mysql_parser_shim.c
  • packages/mysql-on-sqlite/src/mysql/native/class-wp-mysql-native-parser-node.php
  • README.md
  • packages/php-ext-wp-mysql-parser/wasm-spike/Dockerfile.rust
  • packages/php-ext-wp-mysql-parser/src/lib.rs
  • packages/mysql-on-sqlite/src/mysql/native/mysql-rust-bridge.php

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

📝 Walkthrough

The SQLite integration now uses the PHP MySQL lexer and parser. The native Rust extension, its WebAssembly build and publishing workflows, and native-specific validation tools were removed. PHPUnit and benchmark workflows now run without native-extension paths.

Changes: MySQL Parser Runtime and Tooling

Layer / File(s) Summary
Use the PHP parser path
packages/mysql-on-sqlite/src/load.php, packages/mysql-on-sqlite/src/sqlite/class-wp-mysql-on-sqlite.php, packages/mysql-on-sqlite/src/parser/class-wp-parser-grammar.php, packages/mysql-on-sqlite/src/mysql/native/*, packages/mysql-on-sqlite/tests/mysql/WP_MySQL_Parser_Instanceof_Tests.php
The loader always requires the PHP lexer and parser. SQLite parser creation uses remaining lexer tokens. Native parser classes and bridge code were removed. New tests check parser inheritance and AST output.
Remove the native extension and WASM build
packages/php-ext-wp-mysql-parser/**, .github/workflows/publish-wasm-extension-artifact.yml, .github/workflows/wasm-spike.yml, .gitignore, README.md
The Rust extension, its generator, and its WebAssembly build and publishing files were deleted. Extension-specific package documentation, the root README section, and the target ignore rules were removed.
Update test and benchmark workflows
.github/workflows/phpunit-tests.yml, .github/workflows/wp-tests-phpunit*, packages/mysql-on-sqlite/tests/bootstrap.php, packages/mysql-on-sqlite/tests/mysql/native/*, packages/mysql-on-sqlite/tests/tools/*
PHPUnit workflows no longer build or verify the native extension. Native-specific tests and verification tools were removed. The lexer and parser benchmarks use PHP tokens and report php as the implementation.

Priority: ⬇️ Low

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Other

Suggested reviewers: janjakes

Merge Risk: ⚪ Minimal · up to 47ed7

This change removes the optional native parser extension and makes the SQLite driver always use the PHP parser. No concrete merge-blocking risk remains, and installations that still have the old extension enabled should keep working.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 5 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the primary change: removal of the Rust parser extension and its documentation.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 5 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 PHPStan (2.3.0)

PHPStan reported 1 non-file analysis error(s); analysis is incomplete

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Lexer benchmark

Changes to lexer-related files were detected and triggered a benchmark:

Config Base (QPS) This PR (QPS) Speedup
no JIT 89,413 89,539 1.00×
tracing JIT 197,687 197,404 1.00×

Note: Hosted runners are noisy, and absolute numbers vary. Treat the results with caution and verify them locally.

To reproduce locally:

cd packages/mysql-on-sqlite && composer run bench-lexer

@adamziel
adamziel merged commit db55ab1 into trunk Oct 23, 2026
19 of 20 checks passed
@adamziel
adamziel deleted the codex/remove-rust-extension branch October 23, 2026 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant