Skip to content

v0.14.0 — apply preflight for missing snapshot binaries

Choose a tag to compare

@MatthewKennedy MatthewKennedy released this 14 May 11:01
· 7 commits to main since this release
ff99b7d

Apply now hard-fails on missing snapshot binaries

When a snapshot's attachments.json declares binary files that aren't actually present under <snapshot_dir>/uploads/, wp fp apply used to silently land the attachment post row and skip the binary copy — leaving a broken-image front end and exit code 0. Designers hit this after the round-trip:

fp snapshot
docker compose down -v
docker compose up -d
fp apply
# DB has site_logo=42 but /app/web/app/uploads/2026/05/logo.png is missing → 404

This release adds a preflight pass at the top of Restorer::apply(). Missing files surface as a single WP_CLI::error() listing every offending path with a remediation hint. copy_binaries()'s silent continue is replaced with a throw (defense in depth for the preflight→copy race).

What changed

  • New Restorer::verify_attachment_binaries() runs before any DB writes.
  • copy_binaries() now throws instead of silently skipping missing files.
  • New tests/CliRestorerVerifyBinariesTest.php covers both branches.

Behaviour change

A snapshot whose attachments.json declares files not on disk now hard-fails at apply time. Schema is unchanged (fp.snapshot/v5). Most installs see no change — only those whose snapshot dirs were already missing binaries (e.g. corrupted commits, git LFS not pulled, manual cleanup) will surface as failures.

Upgrading

Site composer.json:

-"frankenpress/mu-plugin": "^0.13.0"
+"frankenpress/mu-plugin": "^0.14.0"

Then rebuild and tag the site image, and roll through your GitOps. No data migration, no schema bump.

Full diff

#44

What's Changed

Full Changelog: v0.13.11...v0.14.0