Multisite stranding guard [4/4]: Decline a deactivation that would strand sites the host cannot reach - #49
Multisite stranding guard [4/4]: Decline a deactivation that would strand sites the host cannot reach#49d4mation wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 12 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe PR adds a multisite stranding guard to conflict resolution. It detects unsafe network deactivation, preserves the standalone plugin, queues a notice, tests safe and unsafe topologies, and documents the behavior. ChangesMultisite stranding protection
Estimated code review effort: 2 (Simple) | ~15 minutes Merge Risk: ⚪ Minimal · up to The change adds a localized multisite deactivation guard with associated tests and documentation; no actionable merge-blocking risk remains. Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Resolver
participant Detector
participant PluginState
participant NoticeQueue
Resolver->>Detector: Check whether deactivation would strand sites
Detector->>PluginState: Read network activation state
PluginState-->>Detector: Return standalone and host status
Detector-->>Resolver: Return stranding result
Resolver->>NoticeQueue: Queue stranding notice when needed
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
5ff7e1c to
b274f75
Compare
b274f75 to
46a3d4a
Compare
What: Wire the guard —
Conflict\Detector::deactivation_would_strand_sites(), and theDEACTIVATE-branch check inConflict\Resolverthat declines the deactivation and queues the stranding notice instead.Usage:
Why this way:
The predicate lives on the
Detector, not theResolver. CLAUDE.md's rule is that the resolver reaches the checker through the detector, "without the resolver knowing a container exists." The detector already holds the checker, so the guard is a read-only method there — no constructor change, noProviderchange, and the resolver'sDEACTIVATEbranch just asks it.Opt-in and single-site-safe. With no host basename it returns
falseon a single string compare, ahead of any option read;is_plugin_active_for_network()isfalseoff a network, so the whole predicate isfalseon single site. Every other topology — both network-active, both per-site, a per-site standalone — deactivates exactly as before, which is what keeps existing hosts from regressing.Proven end to end, not just in unit tests.
ConflictTestdrives both the decline and the still-deactivate cases on the real multisite env againstactive_sitewide_plugins, skipping on single site;DetectorTestcovers the four topologies and the opt-out.Stack created with GitHub Stacks CLI • Give Feedback 💬
Summary by CodeRabbit
New Features
Documentation
Bug Fixes