I've been working with this library used with Github Enterprise(v2.19 & v2.20) and I have noticed that it has continued to drift from the Enterprise API, tending to stick with the Github.com API definition. The issues that I've run into in particular surround the TeamsService and progressively adding /org/:org and /organizations/:org_id to the route, which are not present in their GHE counterparts. Though I have noticed this in TeamsService, I imagine it exists elsewhere. Though there is support for creating Enterprise client connections and many API methods continue to work I have seen with each new version more methods drifting away from supporting GHE's API.
For example the (*TeamsService) RemoveTeamMembershipBySlug method will generate the following
Github Golang Lib v31.0.0: DELETE /orgs/:org/teams/:team_slug/memberships/:username
GHE API 2.20: DELETE /teams/:team_id/memberships/:username
ref: https://github.com/google/go-github/blob/v31.0.0/github/teams_members.go#L185
GHE 2.20 API Teams/Members: https://developer.github.com/enterprise/2.20/v3/teams/members
Github.com API Teams/Members: https://developer.github.com/v3/teams/members
Similar disparities exist for many of the methods in the TeamsService type. It appears from previous versions of the library that this drift is continuing to grow away from the GHE API as that and Github.com do. Are there any thoughts or strategies for supporting both Github.com & Github Enterprise APIs with this library?
Hi @chestone, and thank you for your feedback.
The primary goal of this repo has always been to support the latest version of the official public GitHub Developer v3 API, documented here: https://developer.github.com/v3/
We go so far as to try to keep up-to-date with the latest custom preview headers so that cutting-edge features can be tried out with this repo and feedback can be given to the GitHub tech support team.
Where it is possible, we have also attempted to support Enterprise GitHub users.
But with different enterprise installations locked to different versions, this has been difficult.
This is obviously a challenging problem without a clear, easy solution.
My very best recommendation, in all honesty, is to raise this exact same issue as you have stated it with the excellent technical support staff at [email protected]. They are not only experts of both the Enterprise and public APIs, but they may also have thought of this and might have ideas on how to address it.
I'll leave this issue open in case others have ideas or in case you take me up on this suggestion... once you hear back from tech support, I would love to hear how they think that this issue could be addressed.
Thanks again.
I spoke with GitHub support about this and their response was that GHE API lags GitHub.com API but will generally catch up.
It looks like the /organizations/{org_id}/team/{team_id} endpoints have been added in 2.21 of GHE e.g. https://docs.github.com/en/enterprise/2.21/user/rest/reference/teams#get-a-team-by-name
@chestone @r-bennett I'm trying to use go-github library for my enterprise github instance, but the defaultBaseURL always point to https://api.github.com/. Is there a way I can change it to https://[GitHubEnterpriseHostname]/?
See NewEnterpriseClient. Does that do what you're looking for?
On Wed, Oct 7, 2020, 12:36 PM Smit Modi notifications@github.com wrote:
@chestone https://github.com/chestone @r-bennett
https://github.com/r-bennett I'm trying to use go-github library for my
enterprise github instance, but the defaultBaseURL
https://github.com/google/go-github/blob/master/github/github.go#L31
always point to https://api.github.com/. Is there a way I can change it
to https://[GitHubEnterpriseHostname]/?—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/google/go-github/issues/1524#issuecomment-705150587,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAAAIWEKRUQHKCQP4WOPTY3SJS7MZANCNFSM4NBDZ2DA
.
@willnorris Thank you! That's what I was looking for.
Most helpful comment
I spoke with GitHub support about this and their response was that GHE API lags GitHub.com API but will generally catch up.
It looks like the
/organizations/{org_id}/team/{team_id}endpoints have been added in 2.21 of GHE e.g. https://docs.github.com/en/enterprise/2.21/user/rest/reference/teams#get-a-team-by-name