wizzy icon indicating copy to clipboard operation
wizzy copied to clipboard

Wizzy fails for new version of Grafana?

Open coder-salman opened this issue 6 years ago • 7 comments

Wizzy needs rowCount and rows [] for executing copy, move, etc..

`/usr/lib/node_modules/wizzy/src/local/components.js:85 var srcRow = srcRows[srcRowNumber-1];

TypeError: Cannot read property '0' of undefined at Components.moveCopyOrRemove (/usr/lib/node_modules/wizzy/src/local/components.js:85:23) at Commands.instructions (/usr/lib/node_modules/wizzy/src/commands.js:118:15) at Command.listener (/usr/lib/node_modules/wizzy/node_modules/commander/index.js:300:8) at emitOne (events.js:96:13) at Command.emit (events.js:188:7) at Command.parseArgs (/usr/lib/node_modules/wizzy/node_modules/commander/index.js:637:12) at Command.parse (/usr/lib/node_modules/wizzy/node_modules/commander/index.js:457:21) at Object.<anonymous> (/usr/lib/node_modules/wizzy/src/index.js:14:9) at Module._compile (module.js:577:32) at Object.Module._extensions..js (module.js:586:10)

But with latest Grafana versions, we don't have rows so when importing dashboards, above parameters are empty and hence wizzy errors out and cannot process Local Commands.

Will this tool be updated?

Thanks.

coder-salman avatar Jun 27 '18 17:06 coder-salman

Yes . Facing the same issue... Please update wizzy....

adj009 avatar Nov 29 '18 05:11 adj009

Same problem. Need Wizzy updated.

mlavelle42 avatar Dec 04 '18 18:12 mlavelle42

I'm facing same issue. I noticed that the rowCount is also wrongly reported with wizzy summarize dashboard.

Expected:

% wizzy summarize dashboard
Output:
{
  "title": "dashboard-1",
  "rowCount": 3,
  "rows": [
 (snip)
}

Actual:

% wizzy summarize dashboard
Output:
{
  "title": "dashboard-1",
  "rowCount": 0,
  "rows": [],
 (snip)
}

This seems to be the problem relating to the dashboard model change in grafana 4 vs 6. So, essentially, the issue is about dashboard definition in general.

iori-yja avatar Sep 13 '19 13:09 iori-yja

Yes we are aware, I just don't have the time to fix it right now and I still don't have rights to publish a new version

Sytten avatar Sep 13 '19 15:09 Sytten

@Sytten Good to know. Can you briefly share how you expect wizzy to be fixed?

Grafana seems to have many version of dashboard model and they have a big migrator DashboardMigrator.ts. Our main problem here is not having GridLayout capability (https://github.com/grafana/grafana/blob/master/public/app/features/dashboard/state/DashboardMigrator.ts#L378), but there could be more problems.

My just thoughts are:

  1. Have several dashboard definitions in the src/local and routing to them from src/local/dashboard.js.
  2. The biggest change is just GridLayout, so do some tricks in src/local/dashboard.js.
  3. Only support one version by one wizzy release and have a doc to note which version is for which version.

iori-yja avatar Sep 13 '19 20:09 iori-yja

I would say 1 is the most beautiful in the my ideas as well as 3 is for reasonable simplicity, besides, just for my fun, I add tiny logic to handle dashboard summarize command (like 2, just it's quick).

iori-yja avatar Sep 13 '19 20:09 iori-yja

I really didn't have a chance to look into the grid problem, I mostly focused on fixing the remote commands lately. The way I see it, we should only support one version (the latest) and tag the releases according to that (so we could release v6 to be on the same page as grafana).

Sytten avatar Sep 13 '19 21:09 Sytten