🐛 Add reverse dependency check on plugin removal#244
Conversation
- Check getPluginsSyncingTo() before removing a plugin - Block removal if other plugins have sync dependencies on the target - Add --force flag to RemoveCommand for overriding the check - Add MpmError.PluginError.HasDependents error type - Preserve ABI compatibility with overloaded remove() method - Log warning when force-removing a plugin with dependents Closes #232
🚀 Preview of mpmThis preview file are availalble for 7 days. (until 2026-04-04)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 779d893ae6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| suspend fun remove( | ||
| name: PluginName, | ||
| force: Boolean | ||
| ): Either<MpmError, Unit> |
There was a problem hiding this comment.
Keep new remove overload non-abstract for API compatibility
PluginLifecycleService is part of the published mpm-api artifact, and this change adds remove(name, force) as a new abstract method; any third-party implementation compiled against the previous API will not implement it, so mpm remove (now calling the 2-arg overload) can fail at runtime with AbstractMethodError when such an implementation is wired in. To actually preserve compatibility, the new overload should provide a default body (or delegate in the opposite direction) instead of introducing a required abstract member.
Useful? React with 👍 / 👎.
Summary
sync:dependencies on the target--forceflag tompm removecommand to override the checkremove()method in public APITest plan
mpm remove PluginAis blocked when PluginB hassync:PluginAmpm remove PluginA --forcesucceeds with warningmpm remove PluginCworks normally when no dependents existCloses #232