Skip to content

feat(plugins): add plugin framework for extending The Inventory - #187

Merged
Ndevu12 merged 1 commit into
mainfrom
feat/plugins-framework
Jun 23, 2026
Merged

feat(plugins): add plugin framework for extending The Inventory#187
Ndevu12 merged 1 commit into
mainfrom
feat/plugins-framework

Conversation

@Ndevu12

@Ndevu12 Ndevu12 commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Introduce a plugin framework that turns The Inventory into a host for optional, self-contained Django apps. A plugin declares metadata by subclassing plugins.base.PluginConfig in its apps.py, can register DRF ViewSets / extra routes via an api_register module, and is loaded either through INSTALLED_APPS, the PLUGINS env var, or a the_inventory.plugins entry point exposed by an installed distribution.

The framework reuses Django/Celery/Wagtail's existing auto-discovery instead of inventing new machinery: api_register modules are discovered the same way Wagtail discovers wagtail_hooks.

  • src/plugins/: discovery, registry, manager (dependency validation), versioning, settings helpers, management command, and a hello example.
  • Settings-time discovery appends discovered apps to INSTALLED_APPS; api/urls.py applies the populated registry before reading router.urls.
  • Convert the core domain apps (inventory, procurement, reports, sales) to PluginConfig with metadata and dependency declarations.
  • docs/plugins.md authoring guide + README link.
  • tests/plugins/: 30 tests covering registry, manager, settings, versioning, API.
  • gitignore stray default_*.sqlite3 test databases.

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor / chore

Checklist for Contributors

  • Tests added or updated as needed
  • python manage.py test passes locally
  • python manage.py check reports no issues
  • python manage.py makemigrations --check --dry-run shows no missing migrations
  • Code style and linting (ruff check .) pass locally (if configured)
  • Documentation updated where relevant (README.md, CONTRIBUTING.md, docs/*.md)

@Ndevu12 Ndevu12 self-assigned this Jun 23, 2026
@Ndevu12 Ndevu12 added enhancement New feature or request effort:large Significant effort (8+ hours) labels Jun 23, 2026
Introduce a plugin framework that turns The Inventory into a host for
optional, self-contained Django apps. A plugin declares metadata by
subclassing plugins.base.PluginConfig in its apps.py, can register DRF
ViewSets / extra routes via an api_register module, and is loaded either
through INSTALLED_APPS, the PLUGINS env var, or a the_inventory.plugins
entry point exposed by an installed distribution.

The framework reuses Django/Celery/Wagtail's existing auto-discovery
instead of inventing new machinery: api_register modules are discovered
the same way Wagtail discovers wagtail_hooks.

- src/plugins/: discovery, registry, manager (dependency validation),
  versioning, settings helpers, management command, and a hello example.
- Settings-time discovery appends discovered apps to INSTALLED_APPS;
  api/urls.py applies the populated registry before reading router.urls.
- Convert the core domain apps (inventory, procurement, reports, sales)
  to PluginConfig with metadata and dependency declarations.
- docs/plugins.md authoring guide + README link.
- tests/plugins/: 30 tests covering registry, manager, settings, versioning, API.
- gitignore stray default_*.sqlite3 test databases.
@Ndevu12
Ndevu12 force-pushed the feat/plugins-framework branch from d7852ba to 48b698c Compare June 23, 2026 13:50
@Ndevu12 Ndevu12 added area:dx Developer Experience enhancement New feature or request and removed enhancement New feature or request labels Jun 23, 2026
@Ndevu12
Ndevu12 merged commit 21b53c5 into main Jun 23, 2026
9 checks passed
@Ndevu12
Ndevu12 deleted the feat/plugins-framework branch June 23, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dx Developer Experience effort:large Significant effort (8+ hours) enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant