Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grafana v5.0 support #67

Merged
merged 2 commits into from
Mar 12, 2018
Merged

Grafana v5.0 support #67

merged 2 commits into from
Mar 12, 2018

Conversation

stephenyeargin
Copy link
Owner

Fixes #66

This refactors the process by which the Hubot package locates the relevant data in the API response. The original issue came from the elimination of the rows property, replacing it with a coordinate system instead.

# Defaults
apiEndpoint = 'dashboard-solo'
data = dashboard.dashboard
# Handle refactor done for version 5.0.0+
if dashboard.dashboard.panels
# Concept of "rows" was replaced by coordinate system
data.rows = [dashboard.dashboard]
# Handle empty dashboard
if !data.rows?
return sendError 'Dashboard empty.', msg

Note that this will also drop support for versions < 2.0.2 to keep the code a bit cleaner. Users should pin to v1.8.0 if you are using an older version of Grafana.

Fixes #66

This refactors the process by which the Hubot package locates the
relevant data in the API response. The original issue came from the
elimination of the `rows` property, replacing it with a coordinate
system instead.

Note that this will also drop support for versions < 2.0.2 to keep the
code a bit cleaner. Users should pin to `v1.8.0` if you are using an
older version of Grafana.
@stephenyeargin stephenyeargin mentioned this pull request Mar 10, 2018
3 tasks
@stephenyeargin stephenyeargin merged commit 641881a into master Mar 12, 2018
@stephenyeargin stephenyeargin deleted the grafana-v5-support branch March 12, 2018 14:36
stephenyeargin added a commit that referenced this pull request Apr 4, 2018
The changes in #67 needed to be cleaned up a bit.

- Splits the v4 and v5 tests into separate files
- Moves the relevant JSON fixtures into subfolders
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant