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

Chore: Add comments and remove unused code #319

Closed ivanahuckova closed 1 month ago

ivanahuckova commented 1 month ago

This PR includes couple of different things that I discovered while onboarding to a codebase. I am more than happy to break it down to separate PRs if needed.

  1. Removes pkg/plugin/resource_handlers.go as functions and methods are not called from anywhere.
  2. We could then remove package github.com/gorilla/mux, as it was used only in now removed resource_handlers.go and then it was added as indirect dependancy.
  3. Adds comments to methods in DataSource.ts. I believe this is beneficial for us to understand where is what used, as some of these methods are part of DataSourceAPI and not called directly.
  4. Removes async getLabels method as it wasn't called anywhere.
  5. Adds LegacyMetricFindQueryOptions types and removes rangeRaw: options.rangeRaw, as it is always undefined as rangeRaw is not a part of LegacyMetricFindQueryOptions.
  6. Removes ResetButton and LabelSelector components as they are not used anywhere
  7. Brings visibility to dashboard.json for development. I tested it and it is a good dashboard.