OpenTermsArchive / engine

Tracks contractual documents and exposes changes to the terms of online services.
https://opentermsarchive.org
European Union Public License 1.2
111 stars 30 forks source link

Rate Limit GitHub on deployment #986

Closed martinratinaud closed 1 year ago

martinratinaud commented 1 year ago

When a deployment happens, it can happen that the rate limit for GitHub is reached.

Default server-to-server rate limits for GitHub.com
GitHub Apps making server-to-server requests use the installation's minimum rate limit of 5,000 requests per hour. If an application is installed on an organization with more than 20 users, the application receives another 50 requests per hour for each user. Installations that have more than 20 repositories receive another 50 requests per hour for each repository. The maximum rate limit for an installation is 12,500 requests per hour.

Server-to-server rate limits for GitHub Enterprise Cloud
GitHub Apps that are installed on an organization within an enterprise on GitHub.com are subject to a limit of 15,000 requests per hour per organization that has installed the app.

So several options:

martinratinaud commented 1 year ago

Main problem is is that a declaration modification PR merged will trigger a deploy.

When this happens a lot (as it has been the past days, cleaning the contrib collection), the rate limit of GitHub API is touched, causing numerous alert emails to be sent.

As discussed with @MattiSG, here is a proposal PR #992 that will bypass this problem.

What this will do is the following