yanyongyu/githubkit

Support for Enterprise API

evilhamsterman opened this issue ยท 7 comments

For some reason for their v2.0.0 release GitHub split the API reference for regular GitHub and GitHub Enterprise Cloud (Not the GitHub Server you run locally but the GitHub hosted Enterprise). The endpoint is the same api.github.com, but the group enterprise-admin, scim, and server-statistics are not in the regular API specification.

This is a common issue for other packages and I can't figure out why they split it like this. But since this appears to be the one SDK that appears to be able to choose your API could you add support for using the ghec api?

I will make a try to add the ghec api schema ๐Ÿ˜„ , but i'm not sure if it will work properly as I am not familiar with ghes/ghec.

The calls aren't that complicated or different from calls you'd find in the regular API. But there is definitely a distinct lack of packages that support it. Probably because of difficulty testing. I'm the admin for my companies GHEC account, we don't have a GHES server but I'd be happy test the GHEC APIs. At least including them would put you ahead of all other libraries. The only one that even attempts to include some of the GHEC API is PyGitHub but they only support the consumed licenses call.

i have added the ghec schema code generation yesterday but black crashed times and times due to the number of files to format ๐Ÿ˜‚ . I'm migrating the project toolchain to ruff currently but encountered some bug of ruff. i have created an issue to ruff. Once the toolchain works fine, i will make a pull request.

but they only support the consumed licenses call

By the way, what does consumed licensed call mean here?

The consumed licenses is just a call to get a list of licenses and who used them for an enterprise. It is currently the only way to correlate a GitHub User with your corporate User so it's probably why someone asked PyGitHub to include it. But it is only one of many useful available enterprise api calls.

The code is currently pushed to the feat/ghec branch. You can test it by install this branch version. Once i fix the toolchain bug, i will merge this and create a new release.

This is now included in the 0.11.3 release. If you encountered any problem with ghec api, feel free to open a new issue :)