-
Notifications
You must be signed in to change notification settings - Fork 183
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
Update the scheduled event governor based upon the actions rate limit #5816
Conversation
...s/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor.Tests/MockGitHubEventClient.cs
Outdated
Show resolved
Hide resolved
...t-processor/Azure.Sdk.Tools.GitHubEventProcessor/EventProcessing/ScheduledEventProcessing.cs
Show resolved
Hide resolved
tools/github-event-processor/Azure.Sdk.Tools.GitHubEventProcessor/GitHubEventClient.cs
Outdated
Show resolved
Hide resolved
{ | ||
// https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limits-for-requests-from-github-actions | ||
// When using the GITHUB_TOKEN the number of Actions per hour for an Enterprise repository is 15000/hour | ||
public const int ActionRateLimitEnterprise = 15000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After the update you don't use these constants anymore so they could be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They were removed with the last commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some unused constants but otherwise looks good.
Previously, I was ultra-conservative on the governor for scheduled events. The limit was set to 100 items per scheduled task run which is still correct for non-enterprise repository actions. For enterprise, however, the actions rate limit is 15,000 and, in that case, we can allow the scheduled tasks to process up to 1000, which is the number of results you can get back from search calls in a given time without hitting the secondary rate limit.
I also put the scheduled event into a try/finally since, we can hit the secondary rate limit on subsequent calls to get the next page of results. If that happens, we still need to process any pending changes made from previous pages of search results, if there are any.