Skip to content

Migrate calls to Grafana APIs to grafana-openapi-client-go #229

@kelnage

Description

@kelnage

Story (Outcome/Output) (Required)

Our Go actions (integrate and deploy) currently make calls to the Grafana REST API using manually constructed HTTP requests. These APIs may change over time, and such breakages may not be noticed. We should use the grafana/grafana-openapi-client-go to help enforce we are making valid requests.

Context

The grafana-openapi-client-go is a Go library that is created by automatically converting the relevant Grafana OpenAPI specs to Go functions, using strong typing and correct REST paths. This will be more reliable in the future, over our ad-hoc hard-coded API calls.

Definition of Done (Required)

Any call to the Grafana API uses the go client, rather than constructing a HTTP request and decoding its responses.

Testing Plan

The existing integration suite should be applicable here, especially with query testing enabled and once a deployment integration test is implemented. In the meantime, manual testing may be required.

Dependencies (Required)

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    deployerIssues related to the deployment of Grafana assetsintegratorIssues related to the integration of queriestestingRelated to improving the testing of this project

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions