Skip to content

feat: persist marketplace plugin registry in Postgres - #1658

Open
devogechukwu wants to merge 1 commit into
CalloraOrg:mainfrom
devogechukwu:feat/postgres-plugin-registry
Open

devogechukwu wants to merge 1 commit into
CalloraOrg:mainfrom
devogechukwu:feat/postgres-plugin-registry

Conversation

@devogechukwu

Copy link
Copy Markdown

Summary

Persists the community marketplace plugin registry in PostgreSQL behind the PluginRepository interface so registered and installed plugins survive application restarts.

Changes

  • Async repository interface: Updated PluginRepository methods to return Promise and updated InMemoryPluginRepository, src/routes/marketplace/plugins.ts, and src/services/pluginRegistry.test.ts.
  • Database migration: Added migrations/0033_marketplace_plugins.sql and matching rollback migrations/0033_marketplace_plugins.down.sql for the marketplace_plugins table (primary key id, manifest as JSONB, owner_id, status, installed_by, installed_at, created_at).
  • Postgres implementation: Added PostgresPluginRepository in src/services/postgresPluginRepository.ts using atomic INSERT ... ON CONFLICT DO NOTHING and conditional UPDATE/DELETE ... RETURNING queries, preserving all existing conflict/error semantics (409 duplicate register or double install, 400 uninstall when not installed, 403 non-owner delete, admin delete allowed, 404 unknown id).
  • App wiring: Selected PostgresPluginRepository in src/app.ts when a database is configured (!config.demoMode && config.databaseUrl), falling back to defaultPluginRepository otherwise.
  • Tests: Added src/services/postgresPluginRepository.test.ts using pg-mem, covering JSONB manifest round-tripping, restart persistence, concurrent registration of the same id, and install-by-one-user / uninstall-by-another edge cases.

Closes #1559

@drips-wave

drips-wave Bot commented Nov 23, 2026

Copy link
Copy Markdown

@devogechukwu Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Persist the marketplace plugin registry in Postgres

1 participant