Add an api_version field to plugin.json - #2562
Conversation
Plugins can declare which plugin api version they target, so the panel can refuse to load plugins written against a future incompatible api instead of failing in unpredictable ways. The field is optional and defaults to 1, plugins declaring a higher version than the panel supports are marked incompatible before loading, plugins missing the field get a warning note on the plugins page, and p:plugin:make scaffolds the field.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe panel now reads plugin API versions from ChangesPlugin API compatibility
Sequence Diagram(s)sequenceDiagram
participant MakePluginCommand
participant Plugin
participant PluginService
participant PluginResource
MakePluginCommand->>Plugin: read SUPPORTED_API_VERSION
MakePluginCommand-->>PluginService: write api_version to plugin.json
PluginService->>Plugin: evaluate isApiVersionSupported()
Plugin-->>PluginService: return compatibility status
PluginService-->>PluginResource: provide plugin status
PluginResource-->>PluginResource: display missing-version warning
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The API-version compatibility flow has no confirmed merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
|
Why do we need both a |
Example: a plugin says panel_version: Also, panel versions change all the time (features, bug fixes). The API version only changes when the plugin API actually breaks. Paper/Bukkit does the same thing: plugins declare api-version separately from the server version. |
# Conflicts: # app/Console/Commands/Plugin/MakePluginCommand.php
Part of the plugin API contract work.
Plugins can declare which plugin api version they target so the panel can refuse to load plugins written against a future incompatible api instead of failing unpredictably. The field is optional and defaults to 1. Plugins declaring a higher version than the panel supports are marked incompatible before loading using the same status flow as the panel_version check, plugins missing the field get a warning note under their status badge on the plugins page, and
p:plugin:makescaffolds the field.Screenshot