Skip to content

Conversation

@michael-s-molina
Copy link
Member

SUMMARY

Refactors the extension contribution schema to use a consistent nested structure for views and menus.

Problem:
The contribution schema had an inconsistency where views and menus used 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:

// Before (dot-notation keys)
{
  "views": {
    "sqllab.panels": [...]
  },
  "menus": {
    "sqllab.editor": {...}
  }
}

// After (nested structure)
{
  "views": {
    "sqllab": {
      "panels": [...]
    }
  },
  "menus": {
    "sqllab": {
      "editor": {...}
    }
  }
}

Changes:

  1. TypeScript Types (contributions.ts):

    • Added SqlLabLocation type with valid locations
    • Updated ViewContributions and MenuContributions to use nested structure
    • Type-safe: only valid scopes (sqllab) and locations (leftSidebar, rightSidebar, panels, editor, statusBar, results, queryHistory) are allowed
  2. View Locations (SqlLab/contributions.ts):

    • Renamed ViewContribution enum to ViewLocations const object
    • Nested structure: ViewLocations.sqllab.panels instead of ViewContribution.Panels
  3. ExtensionsManager:

    • Updated getViewContributions() and getMenuContributions() to handle nested lookup
    • Splits key on . to access scope[location]
  4. Pydantic Schema (types.py):

    • Updated ContributionConfig to use nested dict structure
  5. Component Updates (8 files):

    • Updated all SQL Lab components to use new ViewLocations.sqllab.* pattern
  6. Documentation (4 files):

    • Updated all extension.json examples in developer portal docs

TESTING INSTRUCTIONS

Test with an extension that uses the new schema:

  • Update an extension's extension.json to use nested structure
  • Build and load the extension
  • Verify views and menus appear correctly in SQL Lab

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Feb 10, 2026

Code Review Agent Run #c6c895

Actionable Suggestions - 0
Review Details
  • Files reviewed - 14 · Commit Range: 637f1cc..637f1cc
    • superset-core/src/superset_core/extensions/types.py
    • superset-frontend/packages/superset-core/src/api/contributions.ts
    • superset-frontend/src/SqlLab/components/AppLayout/AppLayout.test.tsx
    • superset-frontend/src/SqlLab/components/AppLayout/index.tsx
    • superset-frontend/src/SqlLab/components/QueryHistory/index.tsx
    • superset-frontend/src/SqlLab/components/ResultSet/index.tsx
    • superset-frontend/src/SqlLab/components/SouthPane/index.tsx
    • superset-frontend/src/SqlLab/components/SqlEditorTopBar/index.tsx
    • superset-frontend/src/SqlLab/components/StatusBar/index.tsx
    • superset-frontend/src/SqlLab/components/TableExploreTree/index.tsx
    • superset-frontend/src/SqlLab/contributions.ts
    • superset-frontend/src/components/ViewListExtension/ViewListExtension.test.tsx
    • superset-frontend/src/extensions/ExtensionsManager.test.ts
    • superset-frontend/src/extensions/ExtensionsManager.ts
  • Files skipped - 4
    • docs/developer_portal/extensions/contribution-types.md - Reason: Filter setting
    • docs/developer_portal/extensions/development.md - Reason: Filter setting
    • docs/developer_portal/extensions/extension-points/sqllab.md - Reason: Filter setting
    • docs/developer_portal/extensions/quick-start.md - Reason: Filter setting
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@michael-s-molina michael-s-molina moved this from To Do to In Review in Superset Extensions Feb 10, 2026
@github-actions github-actions bot added doc Namespace | Anything related to documentation packages labels Feb 10, 2026
@dosubot dosubot bot added change:frontend Requires changing the frontend doc:developer Developer documentation labels Feb 10, 2026
@netlify
Copy link

netlify bot commented Feb 10, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 637f1cc
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/698b780115f9f50008a33a62
😎 Deploy Preview https://deploy-preview-37856--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@michael-s-molina michael-s-molina merged commit b98b34a into apache:master Feb 10, 2026
85 of 89 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Done in Superset Extensions Feb 10, 2026
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Feb 10, 2026
…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.
@villebro villebro mentioned this pull request Feb 11, 2026
9 tasks
sadpandajoe added a commit that referenced this pull request Feb 11, 2026
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>
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Feb 11, 2026
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".
aminghadersohi added a commit to aminghadersohi/superset that referenced this pull request Feb 11, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:frontend Requires changing the frontend doc:developer Developer documentation doc Namespace | Anything related to documentation packages size/L

Projects

Development

Successfully merging this pull request may close these issues.

2 participants