Skip to content

Update: Add pluginUpdatePolicy and fix plugin update reporting/execution#223

Merged
taylortom merged 1 commit into
masterfrom
feature/plugin-update-policy
Jun 26, 2026
Merged

Update: Add pluginUpdatePolicy and fix plugin update reporting/execution#223
taylortom merged 1 commit into
masterfrom
feature/plugin-update-policy

Conversation

@taylortom

Copy link
Copy Markdown
Contributor

Fixes #222

Update

  • New pluginUpdatePolicy: 'none' | 'custom' | 'all' import setting (default custom): update custom (local) plugins upward, leave managed plugins unless all. Legacy updatePlugins is mapped for compatibility (true→all, explicit false→none, absent→default).
  • Single pure resolvePluginAction is the source of truth for the per-plugin decision; getPluginUpdateStatus is now a thin mapper over it, so the import status report and the executor can no longer disagree.
  • In-place updates to a shared (global) plugin now report the other affected courses via PLUGIN_UPDATE_AFFECTS_COURSES.

Fix

  • Plugin updates were only applied when at least one plugin was also being installed (the install/update block was nested in if (pluginsToInstall.length)); update-only imports silently dropped them while still reporting success. Install/update now runs whenever there's anything to install or update, with the missing-plugin/importPlugins check scoped to actual installs.
  • Rollback metadata (updatedContentPlugins) is now recorded for every update, not only when an install also occurred.
  • Removed the contradictory managed-plugin path that warned "cannot update… managed via UI" and then updated anyway.

Breaking / behaviour change

  • With no flag passed, custom plugins now update upward on import (previously nothing updated by default). Tagged Update for review — retag Breaking if a major bump is preferred. Existing updatePlugins:false callers keep "update nothing" (→ none).

Testing

  • tests/utils-resolvePluginAction.spec.js — table-driven over installed?/older/equal/newer × custom/managed × none/custom/all.
  • tests/utils-resolvePluginUpdatePolicy.spec.js — legacy-flag compat mapping.
  • tests/utils-getPluginUpdateStatus.spec.js — updated to policy semantics and asserts alignment with the resolver.
  • Full suite: 214 passing; standard clean.

Follow-up (out of scope)

  • The UI (adapt-authoring-ui) should expose pluginUpdatePolicy and migrate off the updatePlugins checkbox; until then the new default applies to API callers that omit both fields.

…ion (fixes #222)

Course import had three plugin-update defects:
- the status report (getPluginUpdateStatus) disagreed with the executor, so
  it promised updates that never happened for local installs;
- plugin updates were only applied when at least one plugin was also being
  installed (nested in 'if (pluginsToInstall.length)'), so update-only imports
  silently dropped them while still reporting success;
- there was no way to separate managed from custom plugin updates.

Introduce pluginUpdatePolicy ('none'|'custom'|'all', default 'custom') and a
single pure resolvePluginAction used by both the status report and the
executor so they cannot disagree. Run install/update whenever there is
anything to install or update; record rollback metadata for all updates.
Report which other courses a shared-plugin update affects. Legacy updatePlugins
is mapped for compatibility (true->all, explicit false->none).

Behaviour change: with no flag passed, custom plugins now update upward on
import (previously nothing updated).
@taylortom
taylortom merged commit 81e008d into master Jun 26, 2026
2 checks passed
@taylortom
taylortom deleted the feature/plugin-update-policy branch June 26, 2026 10:26
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 3.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Course import plugin-update logic: status misreports, updates dropped, and no managed/custom separation

1 participant