bujjibabukatta opened a new pull request, #8926:
URL: https://github.com/apache/devlake/pull/8926

   ## Summary
   
   Fixes #8829
   
   MySQL Grafana dashboards break when `teams.id` or `users.id` are
   non-numeric strings (the schema allows `varchar(255)`). Grafana injects
   `$variable` raw into SQL `IN()` clauses, so string values arrive
   unquoted and the query fails.
   
   ## Root Cause
   
   The affected SQL patterns looked like:
   
   ```sql
   -- before
   where team_id in (${team1})
   where t.name in (${team})
   where ua.user_id in (${users})
   ```
   
   Grafana's `${variable:singlequote}` formatter wraps each value in
   single quotes, making the query safe for string IDs. The PostgreSQL
   variants of these dashboards already used this formatter; only the
   MySQL variants were affected.
   
   ## Changes
   
   **`grafana/dashboards/mysql/work-logs.json`**
   - Variable definition query: `${team:singlequote}` for user dropdown
   - All 12 panel `rawSql` blocks: `${users}` → `${users:singlequote}`
   
   **`grafana/dashboards/mysql/dora-by-team.json`**
   - All occurrences of `${team}` → `${team:singlequote}` across all
     panels (Deployment Frequency, Lead Time, Change Failure Rate,
     Recovery Time — both stat cards and monthly bar charts)
   
   
**`grafana/dashboards/mysql/engineering-throughput-and-cycle-time-team-view.json`**
   - All occurrences of `${team1}` / `${team2}` →
     `${team1:singlequote}` / `${team2:singlequote}` across all panels
   
   ## Testing
   
   Verified by inspecting all `rawSql` blocks in each affected file.
   No changes to PostgreSQL dashboards (`grafana/dashboards/postgresql/`)
   as they already use `:singlequote` throughout.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to