-
Notifications
You must be signed in to change notification settings - Fork 81
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
Make pull request assignment loading more robust #1918
Conversation
3871503
to
0d6967e
Compare
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.
Started reviewing the PR, first 3 commits looks good, r=me on them.
I have a question on the fourth and will review the rest tomorrow.
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.
The code looks good to me.
If you have confirmed that it works in practice, let's merge it.
To avoid an unnecessary GitHub REST API call.
To get updated state from GitHub without depending only on webhooks.
It is much faster.
Since there are no more one-off jobs
0d6967e
to
9fdede1
Compare
Well, it's hard to really confirm something with triagebot 😆 But it seems to be loading fine for me locally. I added a small log to give us information when the loading starts and ends. |
This PR reimplements the loading of open pull requests and their assignments to GitHub users. In particular, it changes the implementation from a GraphQL query to REST API calls, which is 5-10x faster based on my measurements, and should avoid the timeouts that I saw in production logs. It also performs this fetch periodically, every 30 minutes, so that we can periodically synchronize the latest state and thus paper over any potentially missed webhooks.
The initial state is also loaded eagerly when triagebot starts, so that we always have a consistent state of the world. If triagebot started without it, it could (in the future, once the workqueue is taken into account) for some time assign PRs based on the assumption that no reviewer has any assigned PRs, which is not great.
Best reviewed commit by commit.
The last two commits remove the GQL query, which is now unused, and also the one-off job mechanism, since the only job that was using it is now a cron job instead.