Skip to content

feat: choose the scheduling driver, list and migrate scheduled events - #470

Merged
ogorzalka merged 5 commits into
release/v13.36.0from
feat/schedule-index-commands
Oct 13, 2026
Merged

ogorzalka merged 5 commits into
release/v13.36.0from
feat/schedule-index-commands

Conversation

@ogorzalka

@ogorzalka ogorzalka commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Step 3 of the pollora/schedule delivery plan (framework side). Stacked on #469: the base is feat/require-schedule-package; retarget to release/v13.36.0 before deleting that branch.

It needs pollora/schedule v0.1.1, which is Pollora/schedule#1 (Action Scheduler driver) and #2 (the cron index and the migrator), neither merged nor tagged yet. The constraint is ^0.1.1 || ^1.0 (the provider calls what 0.1.0 lacks: Schedule::driver(), boot(), Migrator…), so it cannot merge before the tag, and CI fails until then; the tests below were run against the package branch (symlinked). #469 can keep ^0.1.

What it adds

  • config/schedule.php (pollora-schedule tag): driver (POLLORA_SCHEDULE_DRIVER, default wp-cron) and protected_hooks. An unknown driver name falls back to WP-Cron instead of breaking the site, and pollora:doctor says so.
  • pollora:schedule:list (--type, --driver, --site, --network, --json), read from the cron option only. The driver column shows (protected), (fallback) and (to migrate), computed at display time from the engine's protected hooks and the active driver, never stored.
  • pollora:schedule:migrate (--from, --to, --dry-run), a thin wrapper of the package's Migrator.
  • A schedule-driver check for pollora:doctor and Site Health, and an administration notice, both from one ScheduleStatus service so they say the same thing.
  • The provider chooses the driver at registration and finishes the wiring in booted (Schedule::boot()): the application starts before WordPress can take hooks.

Not in this PR (step 5): pollora:schedule:recover, which belongs to the Laravel driver, and the removal of use_laravel_scheduler.

Run on pollora-test

With the package branch and WooCommerce's Action Scheduler: pollora:schedule:list shows the 23 events, 22 (to migrate) and action_scheduler_run_queue (protected); pollora:doctor reports the 23 events with the exact command; pollora:schedule:migrate moves them; the doctor then says the events are kept by action-scheduler; with the site back on wp-cron the doctor reports the 23 left in action-scheduler; pollora:schedule:migrate --to=wp-cron (source guessed) brings them back and the cron option is identical to the start, with nothing left in the Action Scheduler group.

Tests

24 feature tests for the commands, check, notice and provider. Full suite: the same 11 failures as on #469 (no pdo_sqlite on this machine), type coverage 99.1 %, PHPStan, Pint and Rector clean.

Labels are English, like the other commands; the study's « à migrer » is (to migrate).

config/schedule.php names the driver (POLLORA_SCHEDULE_DRIVER) and the hooks
that stay on WP-Cron. pollora:schedule:list reads the cron option, which now
indexes every driver's events, and shows each one's type and driver;
pollora:schedule:migrate moves pending events between drivers. pollora:doctor
and Site Health report an unknown or missing driver, and events a former
driver still keeps.
@ogorzalka
ogorzalka changed the base branch from feat/require-schedule-package to release/v13.36.0 October 13, 2026 12:48
@ogorzalka
ogorzalka merged commit 9a856ff into release/v13.36.0 Oct 13, 2026
10 checks passed
@ogorzalka
ogorzalka deleted the feat/schedule-index-commands branch October 13, 2026 13:21
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