Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I ensure the Jenkins PR build is used for merge checks?

chris_flynn September 17, 2025

We require at least one successful build before a PR can be merged. When the PR is created it immediately recognizes the build for the feature branch, which doesn't do anything, so it completes successfully very fast. But it takes a little bit of time for the PR build to kick off. Which allows enough time for someone to merge the PR before the PR build has actually completed. We use Jenkins for our build pipeline.

How can I help avoid merges before the PR build has successfully completed?

2 answers

0 votes
Saxea _Flowie_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 18, 2025

Hi @chris_flynn ,

Have you enabled the minimum builds check?

 

chris_flynn September 19, 2025

Yes, that is the whole problem. The commit is on a feature branch and a PR branch. The feature branch does not do anything at finishes successfully, before the PR branch runs the tests and fails. So the PR can be merged before the PR branch build finishes.

0 votes
Brandon Keller
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 18, 2025

The issue you’re running into is that Jenkins is reporting the branch build as successful right away, so GitHub (or your SCM) thinks the required check has already passed, even though the actual PR build hasn’t finished. The way around this is to separate the two builds so that only the PR build posts the status that’s marked as required for merging. In Jenkins, you can configure the job or pipeline that runs on pull requests to post its own distinct status, something like “Jenkins PR Build,” instead of reusing the branch build status. Then in your repository settings, you set that PR-specific status as the required check before merging. That way, the merge button won’t unlock until the PR build is done, and the quick branch build won’t cause false positives. If you’re using the GitHub plugin or multibranch pipelines, make sure the PR event triggers and reports correctly so Jenkins is always validating the merge commit, not just the branch head. https://dhcmenu.com/

chris_flynn September 18, 2025

We use Bitbucket Cloud and the Bitbucket branch plugin for Jenkins.

 

Where do I set the the "PR-specific status as the required check before merging" in Bitbucket Cloud?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin Site Admin
TAGS
AUG Leaders

Atlassian Community Events