Hello everyone! My company is using Github Enterpr...
# plugins-general
t
Hello everyone! My company is using Github Enterprise. Can the tap-github be configured to look for repositories in our GHE instead of looking in github.com/repo?
e
Enterprise Server?
t
Yes
I saw a undocumented function
base_api_url
. I tried, it changed the behavior but returned error. We don't know if it is completely implemented. would you know anything about this?
e
> I saw a undocumented function
base_api_url
. Hey @tatchi wiggers! Where did you see that? In the tap code?
If you're looking at MeltanoLabs/tap-github, I think it does have an undocumented
api_url_base
setting that defaults to
<https://api.github.com>
, so you could try setting that to point to your enterprise server URL.
Would have to be something like
http(s)://HOSTNAME/api/v3
j
Thanks @Edgar Ramírez (Arch.dev)! But trying the
<https://HOSTNAME/api/v3>
, I and @tatchi wiggers are facing the following error:
2024-03-04T19:10:41.645398Z [*info*   ] *2024-03-04 16:10:41,162 | INFO   | backoff       | Backing off _request(...) for 2.6s (singer_sdk.exceptions.RetriableAPIError: 401 Client Error: b'{"message":"Must authenticate to access this API.","documentation_url":"<https://docs.github.com/enterprise-server@3.10/rest>"}' (Reason: Unauthorized) for path: /api/v3/graphql)*
However, the gh tokens are correctly configured in the .env (using TAP_GITHUB_AUTH_TOKEN variable)
e
Can you try selecting a single stream to isolate this issue? Might make sense to try syncing just
repositories
and see if it's perhaps a token that's just missing some scopes.
j
Thanks for the reply @Edgar Ramírez (Arch.dev), but the error persists.. follow my meltano.yml config below : Ps: I think I'll try to debug the plugin (I think it's missing some kind of implementation).
👍 1
e
Do let me know if you find anything, or directly submit a PR and I'll find some time to review it 🙂
j
Sure, thanks @Edgar Ramírez (Arch.dev)
@Edgar Ramírez (Arch.dev) The issue is that github tap uses both methods (rest API and graphQL) to get the data from Github. This is okay, but some versions of GitHub Enterprise (e.g., 3.10) have the /v3 in the base URL from the rest API, while the graphQL API does not. Thus, this behavior leads to errors (404) during the requests. An option is to improve the plugin to define different URL settings for GitHub (Rest and GraphQL)? I can help with PR if necessary.
e
That makes sense! I'd be happy to review a PR @Jairo Souza
😀 1