Skip to content

feat: add feature-gated content plugin PoC - #459

Open
oleksgonchar wants to merge 3 commits into
kubeflow:mainfrom
oleksgonchar:poc/framework-agnostic-dashboard-plugins-clean
Open

oleksgonchar wants to merge 3 commits into
kubeflow:mainfrom
oleksgonchar:poc/framework-agnostic-dashboard-plugins-clean

Conversation

@oleksgonchar

Copy link
Copy Markdown

related: #41

Summary

Adds a directional, feature-gated PoC for framework-neutral in-page Dashboard content.

The Angular Dashboard can load a same-origin, self-contained Custom Element bundle
at /plugins/:pluginId and exchange a small property/event contract with it.

What changes

  • Adds ContentPluginHostComponent and the /plugins/:pluginId route.
  • Registers optional content plugins through the Dashboard ConfigMap.
  • Adds the DASHBOARD_CONTENT_PLUGINS_ENABLED feature gate, disabled in the base
    configuration and enabled only by the development overlay.
  • Passes namespace, namespaces, user, theme, and base-path context to plugins.
  • Handles ready, navigate, and error CustomEvents from plugins.
  • Validates the v1 registration contract, same-origin bundle path, and navigation
    requests.
  • Adds React and Lit Custom Element examples plus host/component tests.

Scope and limitations

This is a directional PoC, not production enablement.

  • Existing iframe applications and routes remain unchanged.
  • Content plugins run as trusted first-party JavaScript; Custom Elements and Shadow
    DOM are not security boundaries.
  • Cross-origin bundles, built-in route replacement, CSP/SRI policy, capability
    negotiation, and a shared design-token contract are intentionally out of scope.

Validation

  • git diff --check origin/main...HEAD
  • npm run test:prod in components/centraldashboard-angular/frontend

The test run executed all 42 specs. The local Karma run then reported an afterAll
error from karma-jasmine-html-reporter; this appears after spec execution and is
called out for CI confirmation.

Signed-off-by: Oleksandr Gonchar <ogon@equinor.com>
Signed-off-by: Oleksandr Gonchar <ogon@equinor.com>
@google-oss-prow google-oss-prow Bot added area/dashboard-angular area - related to central dashboard angular size/XXL labels Sep 24, 2026
@google-oss-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign andyatmiami for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@oleksgonchar oleksgonchar changed the title feat(dashboard): add feature-gated content plugin PoC feat: add feature-gated content plugin PoC Sep 24, 2026
@juliusvonkohout
juliusvonkohout requested a balanced review from Copilot October 9, 2026 09:15
@juliusvonkohout

Copy link
Copy Markdown
Member

May you join the salck channel and biweekly meetings to discuss this ?

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Async mount races, destructive test cleanup, and the Node/esbuild version mismatch remain unresolved.

4 open findings
What changed in this PR

Adds a feature-gated Custom Element plugin system to the Angular Central Dashboard, including React and Lit examples.

Changes:

  • Adds plugin registration, routing, validation, context passing, and event handling.
  • Adds example plugins, build tooling, and tests.
  • Enables plugins only in the development overlay.
File Description
manifests/​kustomize/​overlays/​dev/​patches/​configmap.yaml Enables plugins in development.
manifests/​kustomize/​overlays/​dev/​kustomization.yaml Defines the development overlay.
manifests/​kustomize/​base/​configmap.yaml Adds the feature gate and registrations.
frontend/​src/​app/​types/​dashboard-settings.ts Types dashboard settings.
frontend/​src/​app/​types/​dashboard-links.ts Defines plugin registrations.
frontend/​src/​app/​services/​environment.service.ts Publishes dashboard settings.
frontend/​src/​app/​services/​backend.service.ts Fetches dashboard settings.
frontend/​src/​app/​pages/​content-plugin-host/​content-plugin-host.component.ts Implements plugin hosting.
frontend/​src/​app/​pages/​content-plugin-host/​content-plugin-host.component.spec.ts Tests host behavior.
frontend/​src/​app/​pages/​content-plugin-host/​content-plugin-host.component.scss Styles the host.
frontend/​src/​app/​pages/​content-plugin-host/​content-plugin-host.component.html Defines host status and outlet.
frontend/​src/​app/​content-plugins/​hello-react.spec.ts Tests the React example.
frontend/​src/​app/​content-plugins/​hello-lit.spec.ts Tests the Lit example.
frontend/​src/​app/​app.module.ts Registers the host component.
frontend/​src/​app/​app-routing.module.ts Adds the plugin route.
frontend/​plugins/​README.md Documents plugin usage.
frontend/​plugins/​hello-react/​src/​hello-react.ts Implements the React example.
frontend/​plugins/​hello-lit/​src/​hello-lit.ts Implements the Lit example.
frontend/​plugins/​build.mjs Bundles example plugins.
frontend/​package.json Adds build scripts and dependencies.
frontend/​package-lock.json Locks plugin dependencies.
frontend/​.gitignore Ignores generated plugin bundles.
Files not reviewed (1)
  • components/centraldashboard-angular/frontend/package-lock.json: Generated file

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

"babel-loader": "^8.0.6",
"cross-env": "^5.2.1",
"cypress": "~13.13.1",
"esbuild": "0.24.2",
Comment on lines +159 to +165
.then(elementWasDefined => {
if (this.pluginId !== plugin.id || !elementWasDefined) {
if (this.pluginId === plugin.id && !elementWasDefined) {
this.fail('This content plugin did not register its custom element in time.');
}
return;
}
}

describe('dashboard-hello-lit', () => {
afterEach(() => document.body.replaceChildren());
}

describe('dashboard-hello-react', () => {
afterEach(() => document.body.replaceChildren());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/dashboard-angular area - related to central dashboard angular size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants