Skip to content

Simplify SQLite installation caching - #367

Draft
JanJakes wants to merge 1 commit into
wp-cli:mainfrom
JanJakes:sqlite-cache-path
Draft

JanJakes wants to merge 1 commit into
wp-cli:mainfrom
JanJakes:sqlite-cache-path

Conversation

@JanJakes

@JanJakes JanJakes commented Oct 2, 2026 •

Copy link
Copy Markdown

SQLite Database Integration 3.1 will introduce randomized database directories, with db-path.php recording the location relative to its own directory. The .sqlite cache snapshot currently looks for .ht.sqlite and .ht.sqlite.php in wp-content/database. With randomized storage paths, that snapshot is never created, so the installation cache is considered invalid, and each scenario repeats wp core install.

Upon a closer look, it turns out the separate SQLite cache snapshot is not needed, because the SQLite database is already part of the WordPress install snapshot. Removing the duplicate .sqlite snapshot with the fixed-filename lookup simplifies the logic and makes SQLite database caching work also with the new randomized storage.

A focused regression scenario checks path preservation and independent databases across a cold installation and two warm restores. It was tested against the merged SQLite plugin code and releases 3.0.2 and 2.2.23.

Related: WordPress/sqlite-database-integration#502 and WordPress/sqlite-database-integration#512.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

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:

  • composer install: Install dependencies.
  • composer test: Run the full test suite.
  • composer phpcs: Check for code style violations.
  • composer phpcbf: Automatically fix code style violations.
  • composer phpunit: Run unit tests.
  • composer behat: Run behavior-driven tests.

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:123

You can find a list of all available Behat steps in our handbook.

@github-actions github-actions Bot added bug Something isn't working scope:artifacts scope:testing Related to testing labels Oct 2, 2026
@codecov

codecov Bot commented Oct 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Context/FeatureContext.php 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Use the existing installation-directory copy for SQLite databases. It
already includes the database files and db-path.php, including the
randomized directories introduced for SQLite Database Integration 3.1.

Remove the separate fixed-filename snapshot and its validity and cleanup
logic. Cache reuse now depends on the installation directory existing,
so an incomplete copy within a suite no longer triggers a rebuild based
on the missing snapshot. Each suite still starts with an empty cache.

Add a focused regression test for path preservation and independent
databases across a cold installation and two warm restores.

WordPress/sqlite-database-integration#502
WordPress/sqlite-database-integration#512
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working scope:artifacts scope:testing Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant