grafana/plugin-tools

Bug: scenesapp backend created with different plugin-id

briangann opened this issue · 0 comments

Which package(s) does this bug affect?

  • Create Plugin
  • Sign Plugin
  • Plugin E2E

Package versions

@grafana/create-plugin@4.1.0

What happened?

generating a scenes app with backend results in a main.go with a different name as the plugin-id

What you expected to happen

the plugin-id should probably match src/plugin.json

How to reproduce it (as minimally and precisely as possible)

  1. In this environment...
    Node 20
  2. With this config...
    npx
  3. Run '...'
❯ npx @grafana/create-plugin@latest
Need to install the following packages:
@grafana/create-plugin@4.1.0
Ok to proceed? (y) y
✔ What is going to be the name of your plugin? · pleasework
✔ What is the organization name of your plugin? · briangann
✔ How would you describe your plugin? · something
✔ What type of plugin would you like? · scenesapp
✔ Do you want a backend part of your plugin? (y/N) · true
✔ Do you want to add Github CI and Release workflows? (y/N) · true
✔ Do you want to add a Github workflow for automatically checking "Grafana API compatibility" on PRs? (y/N) · true
  1. See error...
❯ grep -r "briangann-pleasework-scenesapp"
./docker-compose.yaml:    container_name: 'briangann-pleasework-scenesapp'
./docker-compose.yaml:      - ./dist:/var/lib/grafana/plugins/briangann-pleasework-scenesapp
./pkg/main.go:	if err := app.Manage("briangann-pleasework-scenesapp", plugin.NewApp, app.ManageOpts{}); err != nil {
❯ grep -r "briangann-pleasework-app" *
provisioning/plugins/app.yaml:  - type: 'briangann-pleasework-app'
src/plugin.json:  "id": "briangann-pleasework-app",

This doesn't appear to cause any issues running the plugin, but there is a disconnect in naming, and also the container_name.

The validator (and gcom) doesn't understand -scenesapp as a suffix, we should probably just use -app here.

Environment

System:
    OS: macOS 14.3
    CPU: (24) x64 12th Gen Intel(R) Core(TM) i9-12900K
    Memory: 20.53 GB / 96.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.0 - ~/.volta/tools/image/node/20.11.0/bin/node
    Yarn: 4.1.0 - ~/.volta/tools/image/yarn/4.1.0/bin/yarn
    npm: 10.2.4 - ~/.volta/tools/image/node/20.11.0/bin/npm
    pnpm: 8.15.1 - ~/.volta/bin/pnpm
  Browsers:
    Brave Browser: 121.1.62.165
    Chrome: 121.0.6167.184
    Safari: 17.3

Additional context

No response