Hello Team,
We'd need to know how we can put a condition with a PR while merging this to the main branch ; so for some PRs I have 2 successful build required but for some of them I need only one green build ; How can I achieve that flexibility?
Thanks,
R..
Hello @Raktim ,
Welcome to Atlassian Community!
You can configure the merge checks by setting up Branch permissions in your repository, where , among other possible checks, you can define the number of successful builds required before merging to a given branch/branch pattern.
You can get more details about branch permissions in the following documentation:
However, since the merge checks in the branch permissions are configured from the pull request's destination branch perspective, and you mentioned your pull request are both merging to main branch, I'm afraid it would not be possible to configure two different rules for main branch, one requiring 1 successful build and the other 2 successful build, as Bitbucket would not be able to know when to apply one rule or another.
The only way current way to achieve different number of required successful builds would be if you were merging to different branches, so you could have one branch permissions setup for each of the destination branches.
Hope that helps to clarify your questions.
Thank you, @Raktim .
Kind regards,
Patrik S
Thanks for clarifying @Patrik S - I understand that @Raktim may have 2 different _source_ branches both merging to main branch. Say we have PRs from bugfix/abc to main require 1 successful build and PRs from feature/xyz require 2 successful builds.
Can you confirm, @Raktim
If that's the use case - Workzone for BB Cloud is an app you can use to define such conditions.
The screenshot doesn't exactly show the number of required builds, but the configs have 2 and 1 required build respectively.
Disclaimer: Izymes just released Workzone Cloud (free) to the MP - let me know if you need any help setting it up.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Ulrich Kuhnhardt _IzymesCo_
yes that was exactly what I wanted ; but let's say we want to configure that so that it works every time . How do I tell BB if for PR 1 is different from Pr 2 ? So I need to use some commit message or branch names ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Raktim - you can differentiate by specifying the source branch and the destination branch in Workzone settings. The required number of successful build will be checked for every PR from the source to destination branch.
Changing the required number of build dynamically when you create the PR (just like adding reviewers) isn't possible AFAIK.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As far as I know required build results can only be set to an absolute number in Bitbucket cloud.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.