Monorepo, GitHub, Require Status Checks

Hi!

We have a big monorepo in GitHub where we run tests using the monorepo-diff-buildkite-plugin which works great for us.

We’ve run into a problem now, though. We want to enable GitHub’s require status checks using GitHubs branch protection. This unfortunately doesn’t work like we imagined (any check that ran must be successful) but in a way where you have to specify which checks need to succeed. Because we run different checks for different PRs, we can’t do that.

There are some workaround one can find on the internet:

  1. For the checks that aren’t running, make dummy checks that simply return true.
  2. Have a separate check that checks if all running checks are succeeding and if so, make that job succeed - and only specify this one check in the GH protection rules.

For 1. - we could do that, but we have a lot of different checks and this would become very unwieldy.

For 2. - this sounds nice, but it also sounds like we’d have to dedicate one buildkite agent per PR to continuously poll the GitHub API or somehow run a job every minute for each PR that is open and not failed/successful.

Did anyone else encounter this issue? Did you find any better solution to this problem? Is there some secret Buildkite setting I’m overlooking (maybe there’s a “run this check after all other checks are run for this PR?” - I’m grasping at straws here, haha).

Thank you all!

Hey @Patrik

Thanks for the message

Adding the branch protection rules and status required check should be done on GitHub. We don’t have a settings for that specifically.

But for Commit Statuses we can show blocked in Github as “passed” or pending to prevent merging PR etc

Cheers!