You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "michael-s-molina (via GitHub)" <gi...@apache.org> on 2026/03/06 14:29:21 UTC
[PR] docs(extensions): fix extension developer documentation and CLI scaffolding [superset]
michael-s-molina opened a new pull request, #38472:
URL: https://github.com/apache/superset/pull/38472
### SUMMARY
Fixes and updates the extension developer documentation to match the actual extension system implementation, and corrects the `superset-extensions-cli` scaffold.
**Documentation**
Several docs contained stale or incorrect patterns copied from earlier designs (e.g., VS Code-style `activate(context)` lifecycle, `extension.json` frontend contribution blocks, wrong API method names and signatures). Updated all extension docs to reflect how the system actually works today.
**`superset-extensions-cli` — remove `__init__.py` generation**
The CLI scaffold was generating `__init__.py` files inside the `superset_extensions/` and `superset_extensions/{publisher}/` namespace directories. This is incorrect: these directories are Python namespace packages (PEP 420), and adding `__init__.py` to them actually breaks the namespace package behavior. Without `__init__.py`, multiple independently installed extensions can all contribute to the same `superset_extensions` namespace. With it, only the first package on `sys.path` wins and the others are silently ignored.
**Docs site infrastructure**
Fixed `@apache-superset/core/ui` references throughout the docs build infrastructure — this subpath does not exist in the package. The correct paths are `@apache-superset/core/components` for UI components and `@apache-superset/core/theme` for `themeObject`.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — documentation and tooling changes only.
### TESTING INSTRUCTIONS
1. Build the docs site and verify the extensions section renders correctly:
```bash
cd docs && yarn start
```
2. Run `superset-extensions init` and confirm the scaffolded project has no `__init__.py` in `superset_extensions/` or `superset_extensions/{publisher}/`.
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] docs(extensions): fix extension developer documentation and CLI scaffolding [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #38472:
URL: https://github.com/apache/superset/pull/38472#issuecomment-4012090613
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/38472?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 65.02%. Comparing base ([`0d5ade6`](https://app.codecov.io/gh/apache/superset/commit/0d5ade6dd31bfdb2dc253642b1d9917f668d5cc7?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`12fa156`](https://app.codecov.io/gh/apache/superset/commit/12fa1562d1af370e66c727b9bb6f7176ed4d32fb?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 5 commits behind head on master.
:x: Your project check has failed because the head coverage (99.24%) is below the target coverage (100.00%). You can increase the head coverage or adjust the [target](https://docs.codecov.com/docs/commit-status#target) coverage.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #38472 +/- ##
==========================================
+ Coverage 64.84% 65.02% +0.18%
==========================================
Files 1815 1820 +5
Lines 72049 72572 +523
Branches 22946 22946
==========================================
+ Hits 46720 47190 +470
- Misses 25329 25382 +53
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/38472/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [superset-extensions-cli](https://app.codecov.io/gh/apache/superset/pull/38472/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `89.86% <ø> (?)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset/pull/38472?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] docs(extensions): fix extension developer documentation and CLI scaffolding [superset]
Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina commented on code in PR #38472:
URL: https://github.com/apache/superset/pull/38472#discussion_r2896608589
##########
docs/developer_docs/extensions/extension-points/editors.md:
##########
@@ -165,21 +145,22 @@ const MonacoSQLEditor = forwardRef<editors.EditorHandle, editors.EditorProps>(
export default MonacoSQLEditor;
```
-### activate.ts
+### index.tsx
+
+Register the editor at module load time from your extension's entry point:
```typescript
import { editors } from '@apache-superset/core';
import MonacoSQLEditor from './MonacoSQLEditor';
-export function activate(context) {
- // Register the Monaco editor for SQL using the contribution ID from extension.json
- const disposable = editors.registerEditorProvider(
- 'monaco-sql-editor.sql',
- MonacoSQLEditor,
- );
-
- context.subscriptions.push(disposable);
-}
+editors.registerEditor(
+ {
+ id: 'my-extension.monaco-sql',
+ name: 'Monaco SQL Editor',
+ languages: ['sql'],
+ },
+ MonacoSQLEditor,
+);
Review Comment:
Will do in a follow-up.
##########
docs/developer_docs/extensions/development.md:
##########
@@ -65,19 +69,20 @@ dataset-references/
│ │ └── 900.038b20cdff6d49cfa8d9.js
│ └── backend
│ └── superset_extensions/
-│ └── dataset_references/
-│ ├── __init__.py
-│ ├── api.py
-│ └── entrypoint.py
-├── dataset-references-1.0.0.supx
+│ └── my_org/
+│ └── dataset_references/
+│ ├── api.py
+│ └── entrypoint.py
+├── my-org.dataset-references-1.0.0.supx
└── README.md
```
-**Note**: The extension ID (`dataset-references`) serves as the basis for all technical names:
-- Directory name: `dataset-references` (kebab-case)
-- Backend Python package: `dataset_references` (snake_case)
-- Frontend package name: `dataset-references` (kebab-case)
-- Module Federation name: `datasetReferences` (camelCase)
+**Note**: With publisher `my-org` and name `dataset-references`, the technical names are:
+- Directory name: `my-org.dataset-references` (kebab-case)
+- Backend Python namespace: `superset_extensions.my_org.dataset_references`
Review Comment:
Will do in a follow-up.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] docs(extensions): fix extension developer documentation and CLI scaffolding [superset]
Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro commented on code in PR #38472:
URL: https://github.com/apache/superset/pull/38472#discussion_r2896477243
##########
docs/developer_docs/extensions/extension-points/editors.md:
##########
@@ -165,21 +145,22 @@ const MonacoSQLEditor = forwardRef<editors.EditorHandle, editors.EditorProps>(
export default MonacoSQLEditor;
```
-### activate.ts
+### index.tsx
+
+Register the editor at module load time from your extension's entry point:
```typescript
import { editors } from '@apache-superset/core';
import MonacoSQLEditor from './MonacoSQLEditor';
-export function activate(context) {
- // Register the Monaco editor for SQL using the contribution ID from extension.json
- const disposable = editors.registerEditorProvider(
- 'monaco-sql-editor.sql',
- MonacoSQLEditor,
- );
-
- context.subscriptions.push(disposable);
-}
+editors.registerEditor(
+ {
+ id: 'my-extension.monaco-sql',
+ name: 'Monaco SQL Editor',
+ languages: ['sql'],
+ },
+ MonacoSQLEditor,
+);
Review Comment:
Slightly forward looking, but worth considering now: IIRC, in the initial `extension.json` based contribution declaration, we had `description` in all contribution objects. I checked that we currently have it in the command and editor registration, but should we add it to all signatures (=add to menu items and views)? It feels this could be in the future when we show contributions in the manifest.
##########
docs/developer_docs/extensions/development.md:
##########
@@ -65,19 +69,20 @@ dataset-references/
│ │ └── 900.038b20cdff6d49cfa8d9.js
│ └── backend
│ └── superset_extensions/
-│ └── dataset_references/
-│ ├── __init__.py
-│ ├── api.py
-│ └── entrypoint.py
-├── dataset-references-1.0.0.supx
+│ └── my_org/
+│ └── dataset_references/
+│ ├── api.py
+│ └── entrypoint.py
+├── my-org.dataset-references-1.0.0.supx
└── README.md
```
-**Note**: The extension ID (`dataset-references`) serves as the basis for all technical names:
-- Directory name: `dataset-references` (kebab-case)
-- Backend Python package: `dataset_references` (snake_case)
-- Frontend package name: `dataset-references` (kebab-case)
-- Module Federation name: `datasetReferences` (camelCase)
+**Note**: With publisher `my-org` and name `dataset-references`, the technical names are:
+- Directory name: `my-org.dataset-references` (kebab-case)
+- Backend Python namespace: `superset_extensions.my_org.dataset_references`
Review Comment:
Did you want to remove the `superset_extensions` namespace in this PR, or do we do it in a follow-up?
```suggestion
- Backend Python namespace: `my_org.dataset_references`
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] docs(extensions): fix extension developer documentation and CLI scaffolding [superset]
Posted by "michael-s-molina (via GitHub)" <gi...@apache.org>.
michael-s-molina merged PR #38472:
URL: https://github.com/apache/superset/pull/38472
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] docs(extensions): fix extension developer documentation and CLI scaffolding [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38472:
URL: https://github.com/apache/superset/pull/38472#issuecomment-4012081700
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org