Skip to content

Fix: adapt graphql path depending on GitHub API endpoint

Daniel Marks requested to merge (removed):fix-github-graphql-api-endpoint into master

What does this MR do and why?

As described in #438358 (comment 1809633987) the import from self-hosted GitHub Enterprise instances is broken. This is due to a problem with the graphql API endpoint: For github.com and self-hosted GitHub Enterprise instances the path is different:

The current implementation does not differ between github.com and GitHub Ent. instances when using the graphql API.

MR acceptance checklist

This change should be backwards compatible. It should have no influence on the currently working import from github.com. The change only introduces logic to adapt the graphql API path (according to the GitHub docs) in case the API host is not the default host (which is api.github.com).

The change should have no effect on performance, reliability or availability.

No additional observability instrumentation required.

No additional documentation required.

The change should not have any security implications.

The change should not interfere with current deployment procedures.

How to set up and validate locally

  1. Import a project from github.com
  2. Import a project from self-hosted GitHub Ent. instance

typebug

Edited by Daniel Marks

Merge request reports