VS-33: expose plugin lifecycle status and normalize installplugin ack #52

Merged
nrupard merged 1 commit from feat/plugin-lifecycle-status-vs-33 into main 2026-06-08 02:09:16 +02:00
Owner

Implements VS-33.

What changed

updatePluginList now reflects real per-plugin lifecycle state, and installplugin acks with a consistent envelope.

  • The Plugins / GetPluginVersions control arm is sourced from a new plugin_lifecycle::list_for_ui, which merges the plugin/<name> lifecycle docs (carrying status: added / installed / disabled) with the on-disk catalog (carrying permissions). Each row now includes status alongside name / version / description / author / permissions. Plugins discovered on disk with no lifecycle doc yet are surfaced as installed. Without a DB the arm falls back to the catalog (no status), as before.
  • PluginStatus gains an Added variant and installed_at becomes #[serde(default)]. Previously list() deserialized every record into PluginRecord, whose enum had no added variant and whose installed_at was required, so a record persisted by addplugin (which stores addedAt, not installed_at, with status: "added") was silently dropped. Added plugins now appear in the next plugins reply with status added.
  • ControlIn::InstallPlugin acks with for: "installplugin" and result: "ok" on success, matching the disableplugin / reloadplugin / removeplugin arms, instead of for: "addplugin" with result: "ok:<name>". The error arm keeps the lifecycle error string as the non-ok result.

Acceptance criteria

  • updatePluginList rows include a status field of added / installed / disabled sourced from the plugin/<name> docs
  • A plugin persisted by addplugin appears in the next plugins reply with status added
  • installplugin acks with for: "installplugin" and result: "ok" on success
  • Existing plugin lifecycle tests still pass

Testing

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 --check and cargo clippy -p meshcentral-web --all-targets -- -D warnings clean.

Implements VS-33. ## What changed `updatePluginList` now reflects real per-plugin lifecycle state, and `installplugin` acks with a consistent envelope. - The `Plugins` / `GetPluginVersions` control arm is sourced from a new `plugin_lifecycle::list_for_ui`, which merges the `plugin/<name>` lifecycle docs (carrying `status`: `added` / `installed` / `disabled`) with the on-disk catalog (carrying `permissions`). Each row now includes `status` alongside `name` / `version` / `description` / `author` / `permissions`. Plugins discovered on disk with no lifecycle doc yet are surfaced as `installed`. Without a DB the arm falls back to the catalog (no status), as before. - `PluginStatus` gains an `Added` variant and `installed_at` becomes `#[serde(default)]`. Previously `list()` deserialized every record into `PluginRecord`, whose enum had no `added` variant and whose `installed_at` was required, so a record persisted by `addplugin` (which stores `addedAt`, not `installed_at`, with `status: "added"`) was silently dropped. Added plugins now appear in the next `plugins` reply with status `added`. - `ControlIn::InstallPlugin` acks with `for: "installplugin"` and `result: "ok"` on success, matching the `disableplugin` / `reloadplugin` / `removeplugin` arms, instead of `for: "addplugin"` with `result: "ok:<name>"`. The error arm keeps the lifecycle error string as the non-`ok` result. ## Acceptance criteria - [x] `updatePluginList` rows include a `status` field of `added` / `installed` / `disabled` sourced from the `plugin/<name>` docs - [x] A plugin persisted by `addplugin` appears in the next `plugins` reply with status `added` - [x] `installplugin` acks with `for: "installplugin"` and `result: "ok"` on success - [x] Existing plugin lifecycle tests still pass ## Testing `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 --check` and `cargo clippy -p meshcentral-web --all-targets -- -D warnings` clean.
feat(web): expose plugin lifecycle status and normalize installplugin ack
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 1m36s
Create release / Create release from merged PR (pull_request) Has been skipped
6c72d83fc7
updatePluginList now reflects real per-plugin lifecycle state. The Plugins / GetPluginVersions reply is sourced from plugin_lifecycle::list_for_ui, which merges the plugin/<name> lifecycle docs (carrying status: added / installed / disabled) with the on-disk catalog (carrying permissions). Plugins present only on disk with no lifecycle doc are reported as installed. The PluginStatus enum gains an Added variant and installed_at becomes optional so addplugin records (which store addedAt, not installed_at) deserialize and surface with status added instead of being silently dropped by list().

InstallPlugin now acks with for: "installplugin" and result "ok" on success, matching the disableplugin / reloadplugin / removeplugin arms, so request_ack-style clients no longer special-case the install envelope. The error arm keeps the lifecycle error string.

#VS-33
nrupard deleted branch feat/plugin-lifecycle-status-vs-33 2026-06-08 02:09:16 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-server!52
No description provided.