tcibinan / flaxo

EdTech platform for practical programming courses
https://flaxo.readthedocs.io/en/latest/
Apache License 2.0
13 stars 6 forks source link

Migrate to GitHub GraphQL API #16

Open tcibinan opened 6 years ago

tcibinan commented 6 years ago

Prerequisites

Currently, GitHub has two api versions:

Flaxo uses GitHub API v3 for all operation which leads to a tremendous performance degradation.

Example

On getting pull requests of the repository (\~ 70 pull requests) performance differs up to 20 times.

REST API GraphQL API
85794 ms 4744 ms

Solution

Perform a consequent migration to github v4 API.

tcibinan commented 5 years ago

It turned out that another huge issue exists with the current usage of the GitHub REST API through the Kohsuke's library.

The amount of extra requests to GitHub API is pretty huge. In particular, to retrieve repository branches at least 3 http requests are performed. It ends up in a significant performance leak on the whole system.

Presumably, the issue can be passed away using lazy-initialized properties and optimized specific requests. The problem should be considered while migrating to GitHub GraphQL API.