grafana / grafana/grafana-postgresql-datasource
Revert PR #114058 and find a way to migrate dashboards
- Dominant language
- Go
- Stars
- 2
- Forks
- 8
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 5
Description
We decided to revert https://github.com/grafana/grafana/pull/114058 as we came into conclusion that there was no change necessary in the code. There was a bug in somewhere else and it caused a wrong behaviour as a default behaviour in sql based datasources. As that bug was resolved now some dashboards are broken. We took broken dashboards is a problem and attempted to fix with https://github.com/grafana/grafana/pull/114058 but it just made the code more complicated and open to future problems. So we consider to revert it but while reverting we don't want to break dashboards that were using the old style query.
What was the old one?
```
// The query
SELECT * FROM grafana.grafana_metric WHERE hostname = '$hostnames' LIMIT 50
// In old buggy interpolation it becomes
SELECT * FROM grafana.grafana_metric WHERE hostname = 'server123' LIMIT 50
// When the interpolation bug was fixed it becomes
SELECT * FROM grafana.grafana_metric WHERE hostname = ''server123'' LIMIT 50
```
The real fix must be removing that additional quotes around template variable in the query if the template variable is `isMulti=true` or/and `includeAll=true`.
See this huge issue thread for more context https://github.com/grafana/grafana/issues/114045
### A/C
1. Find a migration solution that requires no human interaction
2. Provide a script that fetches dashboardjson, fixes those quotes where necessary, pushing them back, without breaking anything.
3. Provide a comprehensive guidance
Contributor guide
Assessment
This issue has not been assessed yet.