Skip to content
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

Github Enterprise API differs significantly from supported in TeamsService methods #1524

Closed
chestone opened this issue May 14, 2020 · 6 comments

Comments

@chestone
Copy link

chestone commented May 14, 2020

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?

@gmlewis
Copy link
Collaborator

gmlewis commented May 15, 2020

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.

@r-bennett
Copy link

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

@smit-modi
Copy link

@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]/?

@willnorris
Copy link
Collaborator

willnorris commented Oct 7, 2020 via email

@smit-modi
Copy link

@willnorris Thank you! That's what I was looking for.

@gmlewis
Copy link
Collaborator

gmlewis commented Aug 6, 2021

Closing resolved issue.

@gmlewis gmlewis closed this as completed Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants