bulldozer icon indicating copy to clipboard operation
bulldozer copied to clipboard

FR: when first enabled, process all open PRs

Open iamdanfox opened this issue 6 years ago • 2 comments

What happened

Someone just asked why bulldozer wasn't working on a PR and all the configuration looked right (bot enabled, correctly configured etc). Turns out it just hadn't delivered any webhooks.

What should have happened

When the bot is first enabled, it should crawl open PRs and merge ones that match the criteria already

iamdanfox avatar Mar 07 '19 17:03 iamdanfox

This would be nice (and policy-bot has the same issue), but detecting when the bot is enabled is slightly involved. If you opt-in specific repositories via the GitHub App settings, we can get webhooks for that. But for places where the app is enabled on a full organization, I think we have to:

  1. Listen for push events on all repositories
  2. For every event, check to see if a bulldozer.yml file was created by that push
  3. If it was, evaluate all open PRs (or only PRs targeting the branch that was updated)

We already do some of that to support PR updates, but I'm not sure we want to add more API calls on an on-going basis for a relatively rare event. Maybe clarifying this behavior in the docs is enough?

bluekeyes avatar Mar 07 '19 17:03 bluekeyes

I think your suggestion of watching the firehose of push events sounds like a pretty good long term solution, if the server can keep up! Don't think adding documentation will stop people from coming and asking us why bulldozer isn't working yet tbh :/

iamdanfox avatar Mar 07 '19 19:03 iamdanfox