yanyongyu / githubkit

The modern, all-batteries-included GitHub SDK for Python, including rest api, graphql, webhooks, like octokit!
MIT License
158 stars 21 forks source link

Support for Enterprise API #92

Closed evilhamsterman closed 3 months ago

evilhamsterman commented 5 months ago

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?

yanyongyu commented 5 months ago

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.

evilhamsterman commented 5 months ago

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.

yanyongyu commented 5 months ago

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.

yanyongyu commented 5 months ago

but they only support the consumed licenses call

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

evilhamsterman commented 4 months ago

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.

yanyongyu commented 4 months ago

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.

yanyongyu commented 3 months ago

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 :)