VS-33: expose plugin lifecycle status and normalize installplugin ack #52
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/plugin-lifecycle-status-vs-33"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements VS-33.
What changed
updatePluginListnow reflects real per-plugin lifecycle state, andinstallpluginacks with a consistent envelope.Plugins/GetPluginVersionscontrol arm is sourced from a newplugin_lifecycle::list_for_ui, which merges theplugin/<name>lifecycle docs (carryingstatus:added/installed/disabled) with the on-disk catalog (carryingpermissions). Each row now includesstatusalongsidename/version/description/author/permissions. Plugins discovered on disk with no lifecycle doc yet are surfaced asinstalled. Without a DB the arm falls back to the catalog (no status), as before.PluginStatusgains anAddedvariant andinstalled_atbecomes#[serde(default)]. Previouslylist()deserialized every record intoPluginRecord, whose enum had noaddedvariant and whoseinstalled_atwas required, so a record persisted byaddplugin(which storesaddedAt, notinstalled_at, withstatus: "added") was silently dropped. Added plugins now appear in the nextpluginsreply with statusadded.ControlIn::InstallPluginacks withfor: "installplugin"andresult: "ok"on success, matching thedisableplugin/reloadplugin/removepluginarms, instead offor: "addplugin"withresult: "ok:<name>". The error arm keeps the lifecycle error string as the non-okresult.Acceptance criteria
updatePluginListrows include astatusfield ofadded/installed/disabledsourced from theplugin/<name>docsaddpluginappears in the nextpluginsreply with statusaddedinstallpluginacks withfor: "installplugin"andresult: "ok"on successTesting
cargo test -p meshcentral-web --lib plugin_lifecycle(9 passed, including 3 new:added_record_is_listed_with_added_status,list_for_ui_merges_status_and_permissions,list_for_ui_surfaces_added_and_disk_only).cargo fmt --checkandcargo clippy -p meshcentral-web --all-targets -- -D warningsclean.