fix(workspaces): run the real cast activation transition on every boot - #12
Merged
Merged
Conversation
- exempt activation flows from the guard's force-on filter under WP_INSTALLING - drive activate_cast() via deactivate_plugins()+activate_plugin() core APIs so CastActivator's schema install actually runs on every boot - assert the export-items table, cast_version, and schema self-heal in verify-wordpress
This comment has been minimized.
This comment has been minimized.
pcfreak30
marked this pull request as ready for review
September 25, 2026 01:52
- verify assertions compared the probe result to a hardcoded wp_ literal while non-default WORDPRESS_TABLE_PREFIX deployments install under another prefix
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The cast guard's read-time force-on filter made every activation path see the
plugin as already active:
wp plugin activateno-oped and core'sactivate_plugin()skipped its activation block on the same filtered read, soCastActivator(schema install,cast_version, rewrite flush) never ran andpublish requests failed on a missing
wp_cast_export_itemstable.Stands the guard filters down under
WP_INSTALLINGand makesactivate_cast()run a real
deactivate_plugins()+activate_plugin()cycle every boot, whichis idempotent and self-heals a lost schema on the next start.
Summary
Fixes a regression where the Cast plugin appeared "active" (via the baked-in
cast-guardMU plugin's read-time filter) but its real activation transition — schema installation,cast_versionmarker, rewrite flush viaCastActivator— never actually ran.Root cause: Because
cast-guardre-adds Cast toactive_pluginson every read of that option, WP-CLI'sis_plugin_active()pre-check and core'sactivate_plugin()both saw Cast as already active and silently skipped the activation block. The result was a plugin that reported active while its DB tables (e.g.,wp_cast_export_items) were never created, causing downstream failures (500s in the publish pipeline).Changes
images/wordpress/mu-plugins/cast-guard.phpWP_INSTALLINGexemption to both theoption_active_pluginsandsite_option_active_sitewide_pluginsfilters.active_pluginsoption — allowingactivate_plugin()to actually execute the activation block.images/wordpress/wp-init.shwp plugin activate cast(which was a no-op due to the guard's filtered read) with awp evalthat runs a real activation cycle on every boot:WP_INSTALLING(scoped to the boot process only) so the guard stands down.deactivate_plugins()(CastDeactivator is a documented no-op).activate_plugin()to run the realCastActivatortransition.dbDeltano-op, while a lost or damaged schema/version marker is repaired on the next boot. Activation failure is non-fatal and leaves a WARN for the next boot to retry.scripts/verify-wordpress.shwp_cast_export_itemstable exists.cast_versionoption is set.cast_versionoption, recreates the container, and verifies the next boot's real activation restores them.Note from code review (medium)
scripts/verify-wordpress.sh:184hardcodes thewp_table prefix in its assertion while probing with$wpdb->prefix— this would cause false failures on non-default table prefixes.