Repository navigation
feat(runpanelquery): run Infinity panels through /api/ds/query - #1345
arunms-ziwo wants to merge 2 commits into
Conversation
run_panel_query rejected panels on the Infinity datasource (yesoreyeram-infinity-datasource) with "datasource type is not supported", so dashboards that read inventory systems such as NetBox over its JSON API could not be executed with variable overrides. Infinity queries are structured targets (url, root_selector, parser, headers, inline data), not string expressions, and the plugin backend runs them when the parser is backend, uql, groq or jq-backend. The target is sent to /api/ds/query as saved, with template variables substituted in every string field, the same way CloudWatch panels are executed. The default "simple" parser parses in the browser, so those panels are refused with a message naming the parser to change. - normalizeDatasourceType maps the plugin ID to "infinity". - extractPanelInfo accepts an empty query expression for structured targets (CloudWatch and Infinity). - executeInfinityPanelQuery, routed from the datasource switch; empty-result hints for the URL and root_selector. - Unit tests for the normalisation, target extraction, the /api/ds/query payload (datasource, parser, substituted url and root_selector, time range) and the parser gate.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit db1dc92. Configure here.
Review findings on the Infinity support: - Only "backend" and "jq-backend" run inside the Infinity plugin backend (its isBackendQuery); UQL and GROQ transform the response in the browser, so they are refused like the default "simple" parser instead of returning untransformed data. - extractPanelInfoV2 accepted an empty query expression for CloudWatch only, so a v2 Infinity panel failed before reaching the executor; it now uses the shared usesStructuredTarget check. Test added for the v2 path.
|
Both Bugbot findings addressed in the follow-up commit: the parser gate now accepts only |

What
run_panel_querynow executes panels on the Infinity datasource (yesoreyeram-infinity-datasource). Infinity targets are structured (url, root_selector, parser, headers, inline data) and the plugin backend runs them for the backend parsers, so the target is sent to/api/ds/queryas saved, with template variables substituted in every string field, the same way CloudWatch panels are executed. Panels using the defaultsimpleparser (browser-side) are refused with a message naming the parser to change;backend,uql,groqandjq-backendare accepted.normalizeDatasourceTypemaps the plugin ID toinfinity.extractPanelInfoaccepts an empty query expression for structured targets (CloudWatch and Infinity share one helper).executeInfinityPanelQuery, routed from the datasource switch; empty-result hints for the URL androot_selector.Why
Dashboards that read inventory or CMDB systems (NetBox and similar JSON APIs) through Infinity could not be executed with variable overrides; the tool answered "datasource type is not supported by run_panel_query".
Tiering
No new tool or parameter: one more datasource type behind the existing
run_panel_query, gated by the samerunpanelquerycategory. The tool description grows by a few words.Tests
Unit tests (
//go:build unit) for type normalisation, target extraction, the/api/ds/querypayload (datasource, parser, substituted url and root_selector, time range), the parser gate and a nil target.go vet,gofmt,make lint-jsonschema lint-openapiandgo test -tags unit ./toolspass locally.