hi,
At first, just to make sure, we use BitBucket server version 7.6.0
I need to disable the "merge" button via Jenkins automation on a PR open.
this is because as long as the build is not successful, the merge button must be disabled.
The disable action is easy. but...
at the end of successful build, I can't enable the merge button because I can't tell if all other conditions of the merge button are met, like # of approvals.
any idea how/if can I get this info from the merge button ?
Bitbucket server project or repo settings let you define merge conditions, including the number of successful builds required. If the condition is not met, the merge button should be disabled.
Internally Bitbucket performs all merge-checks [1] sequentially and if one or more fail the PR can't be merged, i.e. the merge-button is disabled.
Can you elaborate a bit more on how you use Jenkins automation? Are you developing your own app/add-on?
[1] https://confluence.atlassian.com/bitbucketserver/checks-for-merging-pull-requests-776640039.html
although this algorithm is not bullet proof...
PR open triggers a Jenkins job to perform a build, and, in addition to other merge-checks, the build must be successful. but BitBucket's merge-check is on # of successful build(s) and I need the last build to be successful, not just any # of builds, so I ca't use this merge-check, meaning I have to take care of the "Enable merge button' at the end of the build by myself via kind of BitBucket's automation command.
but I can't do this unless all other merge-checks are already done.
this is the info I want to get from BitBucket - are there any uncompleted merge-checkes ?
Atlassian could solve this situation by add a merge-check for the last build.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.