Conversation
| @@ -0,0 +1,36 @@ | |||
| package analyse | |||
There was a problem hiding this comment.
I would write a comment in this mentioning the purpose of these (same thing you wrote on the PR description) to avoid someone coming and completing it with all fields.
| } | ||
| Target struct { | ||
| RefID string `json:"refId"` | ||
| Datasource string `json:"datasource,omitempty"` |
There was a problem hiding this comment.
This will not parse modern dashboards, where this is an object. So we still need either #239 or my change from grafana-tools/sdk#201
There was a problem hiding this comment.
Ah I don't think this field actually gets used anywhere at the moment, so i could remove it.
However if we fork, I agree that it makes more sense to just use the fork instead of the above approach.
There was a problem hiding this comment.
I have a fork at https://github.com/colega/grafana-tools-sdk which you can use here as go mod replacement if you need, I've been merging all the fixes into master there.
| continue | ||
| } | ||
|
|
||
| if err = json.Unmarshal(rawBoard, &board); err != nil { |
There was a problem hiding this comment.
Nit:
| if err = json.Unmarshal(rawBoard, &board); err != nil { | |
| if err := json.Unmarshal(rawBoard, &board); err != nil { |
Even if the outcome is the same, we don't really want to modify the outer err variable.
|
|
||
| for _, link := range boardLinks { | ||
| board, _, err := c.GetDashboardByUID(ctx, link.UID) | ||
| rawBoard, _, err = c.GetRawDashboardBySlug(ctx, link.URI) |
|
Closing in favor of #248 |
* Update Helm release memcached to v5.15.8 Signed-off-by: Renovate Bot <bot@renovateapp.com> * add changelog entry for dependency update Signed-off-by: ShuzZzle <niclas.schad@gmail.com> Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: ShuzZzle <niclas.schad@gmail.com>
The upstream sdk library is now quite out of sync with Grafana and is infrequently updated (as is this tool), and this often results in deserialization errors and breakage (e.g. https://github.com/grafana/support-escalations/issues/2089)
This PR adds a minimal schema which preserves existing functionality of the tool while avoiding all of the data structures and fields not necessary to its functionality. I think it will make this easier to maintain and avoids forking the
sdklibrary.Deserialization additionally tested on kubernetes-mixin. There are also two dashboards included in unit tests.
Closes #241
Deprecates #239
cc @eamonryan @rgeyer