Update Pipeline
Overview
ValPress updates run through a staged pipeline instead of a single opaque action. Each stage produces a structured StageReport with pass, warn, or fail status, optional checks, and repair actions.
The pipeline supports:
- Core updates — full verify + apply flow with snapshot rollback
- Extension updates — plugins and themes through a shorter dedicated flow
Architecture
ValPress 0.6 uses a staged pipeline for updates. The admin UpdateController is a thin HTTP adapter — it validates request input, delegates to services, and returns JSON for the Update Center UI. It does not contain download, migration, or file-copy logic.
HTTP (UpdateController)
├── GET /admin/updates → updates UI
├── GET /admin/updates/check → UpdateCheckService (api.valpress.net)
├── POST /admin/updates/run → UpdatePipeline (verify_step / actual_step)
├── POST /admin/updates/repair → RepairService
├── GET /admin/updates/export-report → UpdateReportService
└── snapshots restore/destroy → SnapshotService
app/Update/
Pipeline/ UpdateContext, UpdatePipeline, UpdatePipelineCatalog
Stages/ Verify/, Apply/, Extension/ (one class per step)
Services/ Dedicated services (see table below)
Reports/ StageReport, CheckResult, RepairAction
Key services
| Service | Responsibility |
|---|---|
UpdatePipeline |
Orchestrates verify/apply steps and aggregates stage reports |
UpdateCheckService |
Queries ValPress API for core, plugin, and theme updates |
UpdateApplyService |
Core file copy, production migrations, cache rebuild, finalize |
ExtensionApplyService |
Extension download, extract, deploy, and version tracking |
ExtensionUpdateService |
Fires post-update hooks only (update_plugin_{slug}, update_theme_{slug}, valpress_extension_updated) |
ExtensionUpdateValidationService |
Resolves ValidatesUpdate implementations and filter-based validation |
RepairService |
Executes whitelisted repair handlers from reports |
SnapshotService |
Core file snapshots before apply; restore and delete |
TestDatabaseService |
Dedicated test database configuration for verify simulation |
UpdateReportService |
Structured, exportable JSON reports |
UpdatePackageService |
Download and extract update archives |
SimulationService |
Isolated copy and PHPUnit execution during verify |
CompatibilityService |
PHP version, disk space, writable paths |
UpdateHealthCheckService |
Routes, views, plugins, and site health during verify/apply |
Extension apply finalize runs through ExtensionFinalizeStage, which calls ExtensionUpdateService::fireExtensionUpdatedHooks() — that service does not handle downloads or file deployment.
Wire protocol
HTTP and JavaScript use the catalog step field (e.g. init, download, health_check). Internal stage classes use a separate key (e.g. verify_init). Do not confuse the two.
Core verify stages
init— prepare logs and test databasedownload— fetch core archiveextract— unpack to isolated directoryprepare_env— configure test environmentmigrate— simulation migrationstest— PHPUnit in isolated copyhealth_check— routes, views, plugins, site healthextension_compat— active extension validatorscompare— detect modified core files
Core apply stages
snapshot— pre-update file snapshotinit— maintenance modecopy_files— deploy core filesmigrate— production migrationsseed— optional seederscache— rebuild cachespost_verify— production health checksfinalize— version bump, hooks, cleanup
On apply failure, core files are auto-restored from the snapshot when available.
Extension verify stages
initdownloadextractvalidate—ValidatesUpdate+ filtersmigrate— extension migrations in test DBtest— extension PHPUnit if present
Extension apply stages
initdownloadextractcopy_files— deploy topublic/plugins/{slug}orpublic/themes/{slug}migratecachepost_verifyfinalize
Extension apply does not create core snapshots or copy core files.
HTTP API
POST /admin/updates/run (requires manage_options)
| Field | Description |
|---|---|
phase |
verify_step or actual_step |
step |
Current pipeline step |
type |
core, plugin, or theme |
slug |
Required for extensions |
version |
Target version |
POST /admin/updates/repair
| Field | Description |
|---|---|
repair_id |
Whitelisted repair handler id |
repair_params |
Optional parameters (e.g. plugin slug) |
Other Update Center routes: GET /admin/updates (UI), GET /admin/updates/check, POST /admin/updates/dismiss, GET /admin/updates/export-report, POST /admin/updates/snapshots/{id}/restore, DELETE /admin/updates/snapshots/{id}.
Hooks
| Hook | Purpose |
|---|---|
valpress_update_verify_stages |
Add/reorder core verify stages |
valpress_update_apply_stages |
Add/reorder core apply stages |
valpress_update_extension_verify_stages |
Extension verify stages |
valpress_update_extension_apply_stages |
Extension apply stages |
valpress_update_health_checks |
Pipeline health checks |
valpress_update_validate_{slug} |
Extension validation filter |
valpress_update_repair_actions |
Register repair buttons |
valpress_update_repair_handlers |
Register repair executors |
valpress_update_pre_{phase} |
Before each step |
valpress_update_post_{phase} |
After each step |