Skip to content

Quarantine retired plugins and clean up leftovers on update#72

Merged
jhd3197 merged 5 commits into
mainfrom
dev
Jul 13, 2026
Merged

Quarantine retired plugins and clean up leftovers on update#72
jhd3197 merged 5 commits into
mainfrom
dev

Conversation

@jhd3197

@jhd3197 jhd3197 commented Jul 13, 2026

Copy link
Copy Markdown
Owner

This pull request introduces a robust mechanism for handling retired plugins/extensions, specifically targeting issues where obsolete plugins like serverkit-workflows could break frontend builds during updates. The changes ensure that retired plugins are neither carried forward during updates nor left in place in existing installations, and that any leftover files or database rows are proactively removed. The update also adds comprehensive tests and scripts to guarantee these behaviors.

Retired Plugin/Extension Handling

  • Added a backend sweep (remove_retired_extensions) that deletes files and database rows for retired extensions before plugins are loaded, preventing them from being loaded or "repaired" after retirement (backend/app/services/extension_migration.py, backend/app/__init__.py). [1] [2]
  • Introduced a list of retired extension slugs (RETIRED_EXTENSION_SLUGS in Python and RETIRED_PLUGIN_SLUGS in shell) to coordinate which plugins are considered retired and ensure both backend and update scripts use a consistent set. [1] [2]

Update Script Improvements

  • The update script now skips copying retired plugins during the carry-forward step, and removes any retired plugin directories left in-place (Docker/in-place upgrades) using remove_retired_plugins. [1] [2] [3]
  • If a carried-forward plugin causes a frontend build failure, the script quarantines those plugins and retries the build, allowing the update to succeed without user intervention. [1] [2]

Testing and Validation

  • Added backend and shell tests to ensure retired plugins are neither preserved nor left in the tree, and that the quarantine mechanism works as expected. [1] [2]

Other

  • Bumped the version to 1.7.34 to reflect these changes.

These changes collectively prevent update failures caused by legacy or incompatible plugins, improving the reliability of both the update process and the running application.

jhd3197 and others added 3 commits July 12, 2026 21:42
The 1.7.25 -> 1.7.33 update broke on panels that still had the retired
serverkit-workflows extension on disk: preserve_installed_plugins carried
it into the fresh tree, where its reactflow import (removed with plan 45)
sank the whole bundle build and blocked the update.

- RETIRED_PLUGIN_SLUGS: the carry-forward now skips slugs the product
  deliberately deleted, and docker in-place mode strips their leftovers
  after the hard reset (untracked dirs survive it).
- Quarantine-and-retry: when the bundle build fails and plugins were
  carried forward, move them into /var/backups/serverkit/quarantined-
  plugins-<ts> and retry once -- fail the plugin, never the update.

The updater self-refreshes from main before running, so this protects
every panel on its next `serverkit update` once merged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Backstop for the updater-side skip: remove_retired_extensions() deletes a
retired extension''s copy-installed files and InstalledPlugin row on every
boot, BEFORE the plugin loader, so it is never loaded, never repaired
back, and never present for an older/offline updater to carry forward
into the next frontend build. Also drops serverkit-workflows from
CONVERTED_BUILTIN_SLUGS -- it no longer ships, so the auto-install
candidate was a permanent no-op.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 13, 2026 01:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the upgrade/boot flow against “retired” plugins/extensions (e.g., serverkit-workflows) so they don’t get carried forward into new installs/slots or linger in-place and break frontend builds. It adds both backend cleanup (files + DB rows) and updater behavior to skip/remove retired plugins, plus tests to lock the behavior in.

Changes:

  • Add a boot-time backend sweep to remove retired extension directories and any installed_plugins DB rows before plugin loading.
  • Update scripts/update.sh to (a) skip carrying retired plugins forward, (b) remove retired plugin leftovers for in-place (Docker) updates, and (c) quarantine carried-forward frontend plugins on build failure and retry once.
  • Add shell + backend tests covering retired-plugin cleanup and quarantine behavior; bump version to 1.7.34.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
VERSION Bumps release version to 1.7.34.
scripts/update.sh Adds retired-plugin skip/removal, quarantining, and build retry logic during updates.
scripts/test/test_update.sh Adds updater tests for retired plugin carry-forward removal and quarantine behavior.
backend/tests/test_extension_migration.py Adds test ensuring retired extension files + DB row are swept at boot and sweep is idempotent.
backend/app/services/extension_migration.py Introduces RETIRED_EXTENSION_SLUGS and remove_retired_extensions() cleanup routine.
backend/app/__init__.py Calls the retired extension sweep before loading plugins.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +75 to +76
except Exception as e: # noqa: BLE001
logger.warning(f'Could not remove retired extension row {slug}: {e}')
Comment thread scripts/update.sh
Comment on lines +865 to +866
{ [ "${2:-}" = "reuse" ] || npm ci --prefer-offline 2>&1 | tail -3; } && \
NODE_OPTIONS="--max-old-space-size=1024" npm run build 2>&1 | tail -5 )
Comment thread scripts/update.sh
Comment on lines +818 to +820
rm -rf "$tree/$sub/$slug" 2>/dev/null || true
info "Removed retired plugin: $sub/$slug"
fi
Comment thread scripts/update.sh
Comment on lines +1675 to +1677
step "Retrying frontend build without carried-forward plugins..."
build_frontend_bundle "$NEXT_DIR" reuse \
|| halt "Frontend build failed — previous installation still active"
jhd3197 and others added 2 commits July 12, 2026 21:59
The release workflow builds linux/amd64,linux/arm64 via buildx + QEMU on
an amd64 runner, so the frontend-builder stage ran `npm ci`/`npm run
build` under emulation for arm64 -- 20-40 minutes when it did not hang
outright. Its output (frontend/dist) is static, arch-independent assets,
so pin the stage to $BUILDPLATFORM: buildx runs it natively, once, shared
by both platform images. Final images are unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jhd3197 jhd3197 merged commit 5697211 into main Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants