-
Notifications
You must be signed in to change notification settings - Fork 70
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
Switch to grafana-golang-api-client #260
Conversation
Hey @mbarrien, Thanks for opening this pull request, as discussed/suggested in #257. So, just to set proper expectations, let me express you that I don't think we'll be able to merge this as-is straight away, cause there's multiple things we need to verify, like:
However, this is definitely super useful, and moves us multiple steps forward in the process of replacing the existing client by the "official" one, so thanks for doing so, I'm sure your contribution will be appreciated! :) Hope to bring back news sooner than later! |
Wasn't expecting it to be merged as is; I know there are regressions. I see you (@joanlopez) have been getting work in the grafana-golang-api-client repo to fix some of them already, but didn't want to rely on an unreleased version in this PR. P.S. If you really want to move things forward... the latest commit in https://github.com/mbarrien/grizzly/tree/openapi attempts a switch to using OpenAPI instead of the "official" repo, using the https://github.com/esnet/grafana-swagger-api-golang library (which is just Bingo run on the openapi3.json from the official Grafana repo, just like https://github.com/grafana/grafana-openapi-client-go would). It works well enough to do grr pull's, at least until I ran into grafana/grafana#76578 for the new Alert Rules functionality I was trying to introduce. |
Hi folks, https://github.com/esnet/grafana-swagger-api-golang was created by a community member who used @papagian's POC to generate the client with swagger. See this comment: grafana/grafana#47827 (comment) - it is not maintained either. The Grafana Backend Platform team is actively working on moving the swagger POC work to grafana/grafana-openapi-client-go, integrate it with all Grafana client dependencies, and deprecate the manual client. Please use that instead. Cheers :) |
@nikimanoledaki With all due respect... it is way too premature to be asking any project to change over to another API right now. All 3 (grafana-golang-api-client, grafana-swagger-api-golang, and grafana-openapi-client-go) have gaps relative to each other.
Are you expecting all development on outside projects to halt until #47827 is resolved? Or even inside projects, since this particular repo grizzly is in Grafana's own Github? Or do you want a Grafana hosted project to switch to an outside implementation to access its own APIs? Or should Grizzly continue to maintain yet a 4th way to access Grafana's APIs, adding to technical debt. (This PR was done in response to #257, where I already saw work to switch to grafana-golang-api-client already underway.) |
@mbarrien I had not seen the issue but it's a good spot. Looking into it now.
That was true before but we generated the client for all Grafana APIs: https://github.com/grafana/grafana-openapi-client-go/tree/main/client You can swap to the Lastly, no, you do not need to wait for #47827 to be complete to use |
Closing in lieu of #262. |
Switches datasource, dashboard, and folder resources to using the grafana-golang-api-client instead of accessing the REST API's directly.
There are some small bits of functionality lost in the change:
In addition to the missing fields, the api client's JSON rendering also has a lot of
omitempty
annotations, which results in many fields no longer being present in the next pull after you change to this code (especially for datasources).If you have previously run grizzly pull, then run grizzly pull again in the new code, you will get diffs like this on all previously pulled resources (anonymized from actual examples):
Datasources:
Dashboards:
Folders: