Skip to content

feat(create-plugin): extend experimental-app-sdk to Go backends - #2856

Draft
stevesg wants to merge 4 commits into
grafana:mainfrom
stevesg:add-app-sdk-backend-support
Draft

feat(create-plugin): extend experimental-app-sdk to Go backends#2856
stevesg wants to merge 4 commits into
grafana:mainfrom
stevesg:add-app-sdk-backend-support

Conversation

@stevesg

@stevesg stevesg commented Aug 27, 2026

Copy link
Copy Markdown

Extends the add experimental-app-sdk to wire up a plugin's Go backend,
for app plugins that have one. When a backend is present:

  • kinds/config.cue: flips codegen: goEnabled: true and sets goGenPath, so
    code generation also emits Go types alongside the existing TypeScript output
  • pkg/provider/provider.go: new template scaffolding the app.Provider/app.App.
  • pkg/main.go: replaces the plain app.Manage(...) call with the app-sdk's
    plugin.Run helper (best effort, significantly reworked main.go's will need
    manual intervention).

Both edits are idempotent and bail out safely (skip + warn) if main.go has
already diverged from the scaffolded shape they expect.

Part of #2842

@grafana-catalog-project-bot grafana-catalog-project-bot Bot moved this from 📬 Triage to 🧑‍💻 In development in Grafana Catalog Team Aug 27, 2026
@stevesg stevesg changed the title add app sdk backend support feat(create-plugin): extend experimental-app-sdk to Go backends Aug 27, 2026
@stevesg
stevesg force-pushed the add-app-sdk-backend-support branch from ed3b5ef to f81e509 Compare August 27, 2026 12:32
Adds opt-in support for `grafana-app-sdk` via feature flag or `add`:

```
$ create-plugin --feature-flags=experimentalAppSdk
$ create-plugin add experimental-app-sdk
```

Code generation runs through `npm run generate:kinds`, a convenience script to
download the grafana-app-sdk binary and run it.

This change covers frontend-only app plugins: `kinds/config.cue` sets
`codegen: goEnabled: false`, so no Go code, go.mod dependency, or backend is
involved. Validation/mutation/conversion and custom routes are not supported.

Summary of changes:

- templates/app-sdk/: CUE kinds, the generate script, and a README
- kinds/config.cue writes the manifest straight into src/app-sdk-manifest.json,
  so the frontend build's existing **/*.json copy pattern picks it up with no
  dedicated copy step
- docker-compose.yaml: enable the plugins.appSDKManifest feature toggle
- AGENTS/: app-sdk.md and edit to instructions.md to point at it
@stevesg
stevesg force-pushed the add-app-sdk-backend-support branch from f81e509 to ca55f6a Compare August 27, 2026 12:38
@stevesg stevesg added the preview Opts the PR into pkg.pr.new preview publishing label Aug 27, 2026
@pkg-pr-new

pkg-pr-new Bot commented Aug 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

@grafana/create-plugin

npm i https://pkg.pr.new/grafana/plugin-tools/@grafana/create-plugin@d67a303 -D

@grafana/eslint-config

npm i https://pkg.pr.new/grafana/plugin-tools/@grafana/eslint-config@d67a303 -D

@grafana/eslint-plugin-plugins

npm i https://pkg.pr.new/grafana/plugin-tools/@grafana/eslint-plugin-plugins@d67a303 -D

@grafana/plugin-docs-cli

npm i https://pkg.pr.new/grafana/plugin-tools/@grafana/plugin-docs-cli@d67a303 -D

@grafana/plugin-docs-parser

npm i https://pkg.pr.new/grafana/plugin-tools/@grafana/plugin-docs-parser@d67a303 -D

@grafana/plugin-e2e

npm i https://pkg.pr.new/grafana/plugin-tools/@grafana/plugin-e2e@d67a303 -D

@grafana/plugin-meta-extractor

npm i https://pkg.pr.new/grafana/plugin-tools/@grafana/plugin-meta-extractor@d67a303 -D

@grafana/plugin-types-bundler

npm i https://pkg.pr.new/grafana/plugin-tools/@grafana/plugin-types-bundler@d67a303 -D

@grafana/react-detect

npm i https://pkg.pr.new/grafana/plugin-tools/@grafana/react-detect@d67a303 -D

@grafana/sign-plugin

npm i https://pkg.pr.new/grafana/plugin-tools/@grafana/sign-plugin@d67a303 -D

@grafana/tsconfig

npm i https://pkg.pr.new/grafana/plugin-tools/@grafana/tsconfig@d67a303 -D

commit: d67a303

Extends the `experimental-app-sdk addition` to wire up a plugin's Go backend,
for app plugins that have one.

When a backend is present:

- kinds/config.cue: flips `codegen: goEnabled: true` and sets `goGenPath`, so
  code generation also emits Go types alongside the existing TypeScript output
- pkg/provider/provider.go: new template scaffolding the app.Provider/app.App.
- pkg/main.go: replaces the plain `app.Manage(...)` call with the app-sdk's
  `plugin.Run` helper (best effort, significantly reworked main.go's will need
  manual intervention).

Both edits are idempotent and bail out safely (skip + warn) if main.go has
already diverged from the scaffolded shape they expect.
@stevesg
stevesg force-pushed the add-app-sdk-backend-support branch from ca55f6a to 58f9908 Compare August 27, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Opts the PR into pkg.pr.new preview publishing

Projects

Status: 🧑‍💻 In development

Development

Successfully merging this pull request may close these issues.

1 participant