Conversation
Use the database selected by WordPress when legacy constants conflict, while retaining the existing fallback for older plugin versions. Cover file operations with conflicting, matching, and legacy settings, including checks that the other database remains unchanged. WordPress/sqlite-database-integration#512
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughSQLite database path lookup now checks ChangesSQLite database path selection
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable issue is established for the SQLite path change; it is mergeable after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to WP-CLI will follow DB_PATH even when older settings point to another database. Existing command safeguards remain, and no new attack path was established. Agreement with the SQLite plugin’s active database has not been independently verified across supported versions. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
Hello! 👋 Thanks for opening this pull request! Please check out our contributing guidelines. We appreciate you taking the initiative to contribute to this project. Contributing isn't limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation. Here are some useful Composer commands to get you started:
To run a single Behat test, you can use the following command: # Run all tests in a single file
composer behat features/some-feature.feature
# Run only a specific scenario (where 123 is the line number of the "Scenario:" title)
composer behat features/some-feature.feature:123You can find a list of all available Behat steps in our handbook. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
DB_PATH for SQLite database commands
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Address the :memory: handling and Windows scenario exclusion issues.
Review effort: Lite
Findings: 2
Open (2)
What changed in this PR
Updates SQLite file operations to prefer DB_PATH while preserving legacy fallbacks.
Changes:
- Adds
DB_PATHprecedence to SQLite path resolution. - Adds Behat coverage for conflicting and legacy configurations.
| File | Summary | Review status |
|---|---|---|
src/DB_Command_SQLite.php |
Resolves the configured SQLite database path. | Moderate issue: handle :memory: explicitly. |
features/db-sqlite-path.feature |
Tests exports and drops against selected databases. | Moderate issue: exclude the file-locking scenario on Windows. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| @@ -0,0 +1,62 @@ | |||
| @require-sqlite | |||
| if ( defined( 'DB_PATH' ) ) { | ||
| return DB_PATH; | ||
| } |

SQLite Database Integration 3.1 will introduce
DB_PATHas the primary database path setting. Legacy constants remain supported, butDB_PATHtakes precedence when both are defined (and conflicting legacy values only trigger warnings).This PR prepares WP-CLI file operations for that change by preferring
DB_PATHwhile retaining the existing fallbacks for older plugin versions.The tests cover conflicting, matching, and legacy-only configurations through export and drop and verify that the other database stays unchanged. The tests were also run against the merged SQLite plugin code.
The Codecov job is failing because coverage is collected only from the MySQL job. The SQLite jobs pass but run without coverage enabled, so Codecov reports the new SQLite lines as uncovered.
Related: WordPress/sqlite-database-integration#512
Summary by CodeRabbit
DB_PATHwhen available, so exports and database removal target the selected database.