grafana / github-datasource

Grafana data source plugin using the Github API to retrieve and visualize Github data.
https://grafana.com/grafana/plugins/grafana-github-datasource/
Apache License 2.0
227 stars 54 forks source link

MultiVar not working in query type Pull Requests #304

Closed Official-James closed 1 month ago

Official-James commented 2 months ago

I am trying to use the $__multiVar variable in the Pull Requests query without success. The example given has only been for the Issues query. Has this been tested or implemented on other query types?

Below is the variable configuration

repo-variable

And this is the query I am running.

datasource-query

The result is no data. Run a single repo query shows the results fine, but I would like to see all the Pull Requests from all repos

gabor commented 2 months ago

hi @Official-James , as a quick check, does this work when you hardcode the name of the repository in the Query field? i mean writing into it the fixed repository:repo_name?

Official-James commented 1 month ago

Hi @gabor. Works fine with query repository:"repo_name"

ivanahuckova commented 1 month ago

Hi @Official-James, I've tried to reproduce your issue following the same setup you have, but in my case with grafana repositories it works as expected.

image image

Could you please share

Thank you!

Official-James commented 1 month ago

Thanks, @ivanahuckova. You are correct; my mistake. I have configured it per the documentation (and your comment) and can confirm that the multiVar does not work on the Vulnerabilities query only. This is why I misconfigured it; I was troubleshooting. I have attached a video confirming that the query works on Pull Requests and not on Vulnerabilities, and using the existing fields works.

https://github.com/grafana/github-datasource/assets/67149897/4af71b5b-cc1c-423a-a993-b26c0f1fb92b

ivanahuckova commented 1 month ago

@Official-James While investigating the issue, I realised that GitHub does not support the query parameter for vulnerabilityAlerts query that we use. Therefore, in that PR, I am removing the query input, as it is misleading.

Additionally, if we want to implement this feature, GitHub would need to support query for vulnerabilityAlerts. If this would be beneficial for you, I recommend starting by writing a feature request here: https://github.com/orgs/community/discussions?discussions_q=is%3Aopen+vulnerabilityAlerts+.

I have provided more details in PR https://github.com/grafana/github-datasource/pull/323 that fixes the bug with showing the query input that should not be there.