How to have multibranch pipeline github checks show "pending" or similar before tests are run

I have multibranch pipeline setup. Currently this happens:

  1. Start with a PR that had a previous failing build. So it shows up in github with red Xs
  2. push a new change to that branch
  3. the checks almost immediately turn Green:

however the build is Queued in jenkins and jenkins has a backlog. So the tests won’t start for a little bit.

IMO this PR should be in some kind of Pending/Yellow state. FWIW, CircleCI does this.

How can I get Jenkins to do this as well?

are you sure circle ci supports it natively? I would expect like jenkins, they don’t know the checks until the file is parsed.

From $WORK i know if you add the check to your branch protection, github will add it to the ui before even getting any data from the check from your CI system, that would be my recommendation.

From $WORK i know if you add the check to your branch protection, github will add it to the ui before even getting any data from the check from your CI system, that would be my recommendation.

Sorry, I’m not following this.

I guess all I know right now is that within moments of pushing to the branch the PR is updated and turned to Green. I guess what you’re suggesting is that that must be github doing that and not Jenkins because Jenkins doesn’t parse the branch until the job/branch begins processing. In my case that’s minutes or hours later based on the queue size.

And it’s Jenkins that actually adds the checks (in their pending state initially).

So it would follow that the only reason it “worked” on CircleCI was because CircleCI allows us almost infinite parallel builds. The jobs never sat in queue for more than 1-2 minutes before starting.

How does that scan?

In the branch protection (under settings) screen in github, you can specifiy that a check needs to pass before its allowed to be merged

eg

I also found from work which often has large backlog of CI requests, github will add a yellow pending status (but no details link) until the CI actually starts running. Then once the CI starts running it updates the check and has a usable details link pointed at the job.

At least thats the case for us at work using non jenkins.