Forums

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

Merging not allowed even after successful build

debedb
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!
December 6, 2019

Merge was being prevented, and I thought that this may be due to the issue in Jenkins itself. After it's been resolved, forced builds succeeded, yet merge was still not enabled.

From this thread I gathered that the build count is attached to commits, not to the PR itself. So I have made a trivial change and committed it forcing a new build which was successful. The bitbucket PR page shows it as such, but yet the merge button still says "There is 1 issue preventing you from merging this pull request. You need a minimum of one successful build before this pull request can be merged."

I am puzzled. Any clues?

1 answer

1 accepted

0 votes
Answer accepted
Evan Slaughter
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 25, 2020

Not sure if you're still experiencing the issue, but one option for troubleshooting is that you can update the status of the failed build over in the REST API.

If the latest commit in your PR is still this commit with a failed build, though, (even if another build was made against that commit that succeeded after the fact) we would expect that it couldn't be merged - as any failed build that hasn't been corrected by the integrated CI tool is assumed to be a result of an issue in the code, meaning that a new commit needs to pushed to the source branch of the PR to fix the code problem.

If this issue is still happening, feel free to post back the results from some of those REST API endpoints if you want help analyzing what you're getting back.

Didier Loiseau
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!
October 14, 2024

If the build failed because of a missing dependency (e.g. because it wasn’t published yet, or some other issue with the repository) or some other issue with the pipeline itself (if managed outside the repository), then you can fix it without commit, and manually re-trigger a build.

Bitbucket will see the successful new build, but since the old, failed build is still there, it will prevent you from merging.

From this comment I understand that you have to either hack through the API or push a fake commit in order to remove the old build, right? Not very nice…

(this is with Jenkins btw)

Like • 2 people like this
Evan Slaughter
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 13, 2025

Late to respond to this, sorry! 

So this is what I am referring to when I stated "that hasn't been corrected by the integrated CI tool". If the CI tooling re-runs the build and posts/corrects the build status for that same build key, it will overwrite the previous status turning the failure into a success. With that, the merge check should pass, as all builds would be passing for the head commit, which would remain the same.

Sorry for any lack of clarity! 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events