Repository navigation
Let installed extensions add routes, migrations and dashboard pages - #443
Merged
Merged
Conversation
Extensions registered under the inferia.extensions entry point are mounted on the gateway at startup and migrated after core's migrations, in both init and migrate. The dashboard lists the pages they offer at /ext/_pages, shows each in its sidebar section, and loads its module inside the dashboard: fetched with the signed-in client and imported from a Blob URL, since the gateway takes only a Bearer header. With nothing installed nothing changes, and an extension that fails is logged and skipped. Signed-off-by: Priyanshu-u07 <connect.priyanshu8271@gmail.com>
Signed-off-by: Priyanshu-u07 <connect.priyanshu8271@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Lets packages installed alongside InferiaLLM extend it, through the
inferia.extensionsentry point. An extension may provide:mount(app): called at gateway startup after core's routes; extensions add routes under their own prefix.migrate(dsn): called from_apply_migrationsafter core's migrations, so it runs on bothinitandmigrate./api/ext/_pages, adds each page to its sidebar section (Monitor, Build or Admin) and loads its module at/dashboard/ext/:plugin/:page. The module is fetched with the signed-in API client and imported from a Blob URL, since the gateway accepts only a Bearer header; it exportsmount(element, { api, version })and returns an unmount function (page contract 1).With nothing installed, nothing changes: no routes, no migrations, and an empty page list (the listing returns 404, treated as "none installed"). An extension that fails to load, mount or migrate is logged and skipped, so InferiaLLM always starts.
Notes
PermissionGuard.Testing
src/tests/common/test_extensions.py: nothing installed, mount and migrate called, a failing extension skipped, core migrations before extensions.useExtensionPages.test.tsx(listing, contract filtering, 404 vs other errors, page not found / could not be loaded). Full suite 497 passed; build and lint pass; no new type errors._apply_migrationscreated its schema, idempotently on a second run.