Skip to content

Synchronize state after (re)start and periodically #266

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

Closed
Kobzol opened this issue Apr 2, 2025 · 1 comment · Fixed by #276
Closed

Synchronize state after (re)start and periodically #266

Kobzol opened this issue Apr 2, 2025 · 1 comment · Fixed by #276

Comments

@Kobzol
Copy link
Contributor

Kobzol commented Apr 2, 2025

One important piece of state that bors should have up-to-date is the queue of (open) PRs. However, when a PR is closed/merged/converted to draft while the bors is offline or being redeployed, or a PR status change webhook is lost, the state in the bors DB can become outdated.

We do update the PR state after every comment on that PR that contains a known bors command, but it would be nice to also update the PRs proactively.

When the bot starts, or in the periodic refresh handler, we could update all opened PRs in our DB, and check if they are still opened. However, doing this one-by-one would be very slow and create many GitHub requests. What we could do instead is batch load PRs with a specific state (opened) from GH, which allows loading 100 PRs at once, and also batch load opened PRs from our DB. Then, when we find a PR where the opened state on GH does not match the state in DB, we update the DB state. See here for an example of how to load that data.

@geetanshjuneja
Copy link
Contributor

Hi, I'll work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants