Search before asking
What happened
With the properly configured teams Grafana Work Logs dashboard could not select user after team selection, and then could not produce any data on a panel. I suspect there are a number of other boards with the same problem.
What do you expect to happen
User dropdown works successfully, leading to proper data in panels for all boards relying on "teams" and "users" DB tables
How to reproduce
Problem is with the teams' and users' IDs. DB fields for those are varchar(255), so we can put any string there (although examples are with numbers only for some reasons). Documentation says nothing about field contents.
And then dashboard' variables and panels do not quote these IDs data in SQL, e.g.:
https://github.com/apache/incubator-devlake/blob/main/grafana/dashboards/WorkLogs.json#L1447
"query": "select concat(users.name, '--', users.id) from users left join team_users on users.id = team_users.user_id where team_users.team_id in ($team)",
So it works well only with numbers right now, as they are injected safely. Please decide, either numbers only, or string support in grafana (I would vote for the second).
Anything else
The regexp logic applied to the dashboard variables to compile proper dropdown implies bit does not state anywhere that team or user ID should not contain -- , or everything will break apart.
Version
v1.0.3-beta10
Are you willing to submit PR?
Code of Conduct
Search before asking
What happened
With the properly configured teams Grafana Work Logs dashboard could not select user after team selection, and then could not produce any data on a panel. I suspect there are a number of other boards with the same problem.
What do you expect to happen
User dropdown works successfully, leading to proper data in panels for all boards relying on "teams" and "users" DB tables
How to reproduce
Problem is with the teams' and users' IDs. DB fields for those are
varchar(255), so we can put any string there (although examples are with numbers only for some reasons). Documentation says nothing about field contents.And then dashboard' variables and panels do not quote these IDs data in SQL, e.g.:
https://github.com/apache/incubator-devlake/blob/main/grafana/dashboards/WorkLogs.json#L1447
So it works well only with numbers right now, as they are injected safely. Please decide, either numbers only, or string support in grafana (I would vote for the second).
Anything else
The regexp logic applied to the dashboard variables to compile proper dropdown implies bit does not state anywhere that team or user ID should not contain
--, or everything will break apart.Version
v1.0.3-beta10
Are you willing to submit PR?
Code of Conduct