Skip to content

[Bug][Grafana] team-related dashboards are failing with non-numeric IDs #8829

@mcseemz

Description

@mcseemz

Search before asking

  • I had searched in the issues and found no similar issues.

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.

Image

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?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/extThis issue or PR relates to external components, such as Grafanapriority/highThis issue is very importantseverity/p1This bug affects functionality or significantly affect uxtype/bugThis issue is a bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions