feat(plugins): gate plugin registries against drift - #568
Draft
hamza-56 wants to merge 1 commit into
Draft
Conversation
A mismatch between the two registries was silent: the frontend could miss a static route (google-drive was absent from generateStaticParams) or register a plugin the backend never declared (#565, item 4 of #372). - scripts/dump_frontend_plugins.py dumps the FRONTEND_APPS declarations offline (the loader is DB-free) as frontend/lib/plugins/generated.ts, regenerated with `make frontend.build.plugins`. - generateStaticParams derives the dashboard plugin routes from the generated list instead of a hand-maintained array. - Drift is a red build on both tiers: pytest fails when the committed list is stale vs the declarations, vitest fails when the frontend registry does not match the list.
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.
Part of: Plugin identity and display metadata are split across disconnected backend and frontend registries
Final PR of the sequence proposed in #372, stacked on #567. Together with #566 and #567 this closes #565.
What
A mismatch between the backend's plugin declarations and the frontend registry becomes a red build instead of a silently missing dashboard page: the frontend's plugin route list is generated from the backend
FRONTEND_APPSdeclarations, and tests on both tiers fail on drift.Changes
scripts/dump_frontend_plugins.pydumps theFRONTEND_APPSdeclarations offline (the loader is DB-free) asfrontend/lib/plugins/generated.tsgenerateStaticParamsderives the dashboard plugin routes from the generated list instead of a hand-maintained arraymake frontend.build.pluginsregenerates the committed listtests/core/test_dump_frontend_plugins.py)lib/tests/plugin-registry-drift.test.ts)How to Test
uv run pytest tests/core/test_dump_frontend_plugins.pycd frontend && bun run test lib/tests/plugin-registry-drift.test.tsFRONTEND_APPS.add_item(...)from a plugin without regenerating: step 1 fails. Regenerate withmake frontend.build.plugins: step 2 fails until the frontend definition is removed too.Notes
PluginDefinitionand the metadata hooks from feat(plugins): backend-declared plugin names and frontend metadata #566).make test.backend/make test.frontendlanes.This PR description was written with the assistance of an LLM (Claude).