Repository navigation
Pattern Translations: Restore cron job output under Cavalcade - #785
Conversation
On WordPress.org, Cavalcade runs jobs through a custom loader rather than WP-CLI, so `WP_CLI` is never defined and the guarded `WP_CLI::log()` calls print nothing. Job output has been empty since those calls replaced the previous `echo`/`printf` statements. Route progress messages through a helper that uses WP_CLI::log() under WP-CLI and echoes otherwise, and remove the per-pattern error_log() that was added as a workaround.
|
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 configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughCron progress messages now use ChangesCron progress logging
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to Progress messages now fall back to PHP output when WP-CLI is unavailable, but Cavalcade’s handling of that output is not confirmed here. No material merge-blocking risk is established; residual risk is minimal. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Follow-up to #784.
The pattern translation cron jobs have logged no output since the sync of ca865d8 on 2026-09-15. That cleanup replaced their
echo/printfcalls withWP_CLI::log()guarded bydefined( 'WP_CLI' ) && WP_CLI. On WordPress.org, Cavalcade doesn't start jobs through WP-CLI:bin/cavalcade/dotorg-hooks.phpruns them viawp-loader.php, which loads WordPress directly, soWP_CLIis never defined and every guarded call is skipped. The runner records whatever a job writes to stdout/stderr, so plain output gets captured.The parent job's Cavalcade log shows the cutoff:
Queued 46 cron jobs of 50 Patterns each.is present on every run through 2026-09-15 06:46 UTC and absent from 18:46 UTC onward.log_message()helper that usesWP_CLI::log()under WP-CLI and echoes otherwise, and use it for every progress message. This restores the output both cron hooks had before.error_log()added in Pattern Translations: Clear runtime caches after each locale #784 as a workaround. Pattern Translations: Clear runtime caches after each locale #784 blamed Cavalcade for dropping the output, which was wrong, and the workaround would have written ~2,300 lines to the server error log on every run.error_log(), which repeated the same wrong claim.Not tested under Cavalcade. phpcs passes.
🤖 Generated with Claude Code
Summary by CodeRabbit