<div dir="ltr"><div><div><div><div><div><div>How do you trigger a build when a pull request is created?<br><br>I'm trying to create a custom notifier that auto-declines pull requests if the build fails. I was planning to implement this similar to the built-in `mail.Notifier`, and use Github/Bitbucket's API to lookup the build's branch ID in the list of open pull requests.<br><br>However, I'm finding that Gitpoller only triggers a build for a normal commit, not when a pull request is created. Depending on how fast the user creates their pull request vs how quickly the build fails, this creates a possible race condition like:<br><br></div>1. user commits their branch<br></div>2. buildbot detects commit and begins the build<br>3a. user creates pull request</div>3b. buildbot finishes build and checks Github/Bitbucket for open pull request<br></div><br></div>Events 3a and 3b may or may not happen in that order. Ideally, 3a happens before 3b, but if the user is slow to create their pull request after their commit, and something in their commit causes the build to fail early, Buildbot will go to check for the pull request and find nothing. How do I prevent this from happening?<br><br></div><div>Regards,<br></div>Chris<br></div>