sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Status of Project?

Open safaci2000 opened this issue 3 years ago • 3 comments

I see several PRs and tickets that are months old and I also had a few commits in that have been pending for a while. I understand that everyone has their lives and such that keeps them busy. I'm just curious if maybe you guys are looking for help? or what the interest is in the sdk at this point?

I ended up forking the project and using the fork in my own project since the PRs were taking too long to get in but this seems like a pretty active project so I'd love to be able to contribute back to it and help if I can. Particularly since work has an interest in the tools i'm developing with SDK so I can do spend some paid cycles on this.

Any updates would be appreciated.

safaci2000 avatar Jun 24 '21 14:06 safaci2000

You are correct that this project is a bit neglected ATM. IRL is taking up a lot of my time nowadays. Lots of work needs to be done. Some things that pop to my mind:

  • Divide the package along Grafana's major versions: v6, v7, v8, ..., etc.
  • Clean up the function parameters to have the standards everywhere & return values
  • Avoid using interface{} and make some kind of wrappers for sum types; start using generics when Go 2.x comes around. Due to this, I am a bit reluctant to merge PRs where the type is simply changed to a interface{}. We should try to expand https://github.com/grafana-tools/sdk/blob/f7c763c3738c279f7e926c5a3bc8353b4080312b/custom-types.go.
  • All of the other issues on this repo

I have heard some good news that Grafana folks are working on a formal spec for the API so hopefully, things will be easier in the future.

If you have some free time to work on this repo then maybe we can create some small channel for this library somewhere (IRC? Slack?) and discuss matters in there? I'm open to adding more maintainers.

GiedriusS avatar Jun 25 '21 15:06 GiedriusS

the interface{} is indeed something to avoid but a bit harder to handle when the return type of the same field changes datatypes in the same request. That's such a horrible design IMO.

My ask if you have the time.

  1. If you have a roadmap or such on what you'd like to get done I can try to help that along. (besides what you wrote above)
  2. CustomTypes is fine, though something I haven't been able to find is a contract definition where the Grafana API defines what values field X is going to look like. Most of the bugs/fixes I've been doing is due to testing where I find behavior breaks things.
  3. I think another item to add that would be a nice to have is breaking the calls into an Admin calls and regular APIs. There's a subset of API calls that seem to not support token base Auth. Maybe even validate the type of auth against the call and just fail before even making the call.

+1 for versioning though, it'd be great to just set a version of grafana when you get the client, and reflect which calls are supported.

safaci2000 avatar Jun 25 '21 15:06 safaci2000

the interface{} is indeed something to avoid but a bit harder to handle when the return type of the same field changes datatypes in the same request. That's such a horrible design IMO.

My ask if you have the time.

  1. If you have a roadmap or such on what you'd like to get done I can try to help that along. (besides what you wrote above)
  2. CustomTypes is fine, though something I haven't been able to find is a contract definition where the Grafana API defines what values field X is going to look like. Most of the bugs/fixes I've been doing is due to testing where I find behavior breaks things.
  3. I think another item to add that would be a nice to have is breaking the calls into an Admin calls and regular APIs. There's a subset of API calls that seem to not support token base Auth. Maybe even validate the type of auth against the call and just fail before even making the call.

+1 for versioning though, it'd be great to just set a version of grafana when you get the client, and reflect which calls are supported.

I don't think there's anything else besides what's in that list + in the bug tracker here. And also of course ideally we'd have 100% API coverage :smile:

As for (2), I typically look into the TypeScript code to see what types are accepted for variables. Some Grafana folks recently have contacted me and they told me that they are working on defining a full API contract so the future looks bright :crossed_fingers:

(3) sounds good, I wasn't aware of that :smile: I need to finish https://github.com/grafana-tools/sdk/pull/129 now because Travis seems to be completely dead (:

GiedriusS avatar Jun 30 '21 21:06 GiedriusS