-
Notifications
You must be signed in to change notification settings - Fork 16.7k
refactor: Make extensions contribution schema consistent #37856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Make extensions contribution schema consistent #37856
Conversation
Code Review Agent Run #c6c895Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
villebro
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
…chema The views schema was changed to nested Dict[scope, Dict[location, List]] in apache#37856 but the test still used the old flat "sqllab.panels" key format. Update to use nested {"sqllab": {"panels": [...]}} structure.
PR #37856 changed ContributionConfig.views from flat dotted keys ("sqllab.panels") to nested dicts ({"sqllab": {"panels": [...]}}) but didn't update the test fixture. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR apache#37856 changed ContributionConfig.views from dict[str, list[...]] to dict[str, dict[str, list[...]]] but didn't update this test. Update test data from flat "sqllab.panels" key to nested "sqllab" -> "panels".
…chema The views schema was changed to nested Dict[scope, Dict[location, List]] in apache#37856 but the test still used the old flat "sqllab.panels" key format. Update to use nested {"sqllab": {"panels": [...]}} structure.
SUMMARY
Refactors the extension contribution schema to use a consistent nested structure for views and menus.
Problem:
The contribution schema had an inconsistency where
viewsandmenusused dot-notation string keys like"sqllab.panels"or"sqllab.editor"instead of a properly nested object structure.Solution:
Changed to a fully nested structure where scope and location are separate object levels:
Changes:
TypeScript Types (
contributions.ts):SqlLabLocationtype with valid locationsViewContributionsandMenuContributionsto use nested structuresqllab) and locations (leftSidebar,rightSidebar,panels,editor,statusBar,results,queryHistory) are allowedView Locations (
SqlLab/contributions.ts):ViewContributionenum toViewLocationsconst objectViewLocations.sqllab.panelsinstead ofViewContribution.PanelsExtensionsManager:
getViewContributions()andgetMenuContributions()to handle nested lookup.to accessscope[location]Pydantic Schema (
types.py):ContributionConfigto use nested dict structureComponent Updates (8 files):
ViewLocations.sqllab.*patternDocumentation (4 files):
TESTING INSTRUCTIONS
Test with an extension that uses the new schema:
extension.jsonto use nested structureADDITIONAL INFORMATION