Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Blue Ocean - How Do I Track Pull Requests AND the Master Branch

Tags:

I'm using Blue Ocean against Bitbucket Server. I want a new build to occur:

  • When a Pull Request is created or updated
  • When master is updated (basically, when a PR is merged to master)

It appears that I can do the first by choosing "Discover Branches: Only branches that are also filed as PR's". I can do the second by choosing "Filter by name: master".

But if I specify both, it seems to apply the name filter to discovered branches, so no PR's are ever discovered. Furthermore, it never builds master because master is never the subject of a PR (we have master locked against direct commits, as is common in enterprise development.)

like image 476
Craig Riecke Avatar asked Oct 18 '17 15:10

Craig Riecke


1 Answers

I figured it out but it was not intuitive. You must add two BitBucket Branch Sources, both pointing to the same Repository. The first must be the Filter by Name: Master. The second must be "Discover Branches: Only branches that are also filed as PR's". If they're in the opposite order, they won't work.

like image 90
Craig Riecke Avatar answered Oct 12 '22 14:10

Craig Riecke