Hi there,
We're using Bitbucket cloud and lately we have activated premium to use branch permissions. This works great, except when we create a hotfix branch, prefixed with "hotfix/" (eq. the git flow principles) and want to merge the hotfix back into master and develop.
This is how we have branch permissions configured;
- 2 usergroups:
- 1 for all developers
- 1 for admins only
- Branch: develop
- Write access: none
- Deleting this branch not allowed
- Rewriting branch history not allowed
- Merge via PR: developers
- Check for at least 2 approvals
- Check for unresolved PR tasks
- Approvals reset when source branch updated
- Merging with unresolved checks is not allowed
- Branch: master
- Write access: none
- Deleting this branch not allowed
- Rewriting branch history not allowed
- Merge via PR: administrators
- Check for at least 1 approval
- Check for unresolved PR tasks
- Approvals reset when source branch updated
This normally is exactly what we want. Every developer can PR to develop, merge when they got enough approvals and they can create a PR to master (for production release request) but normal developers can't merge it since that's a "admin" only task.
So far so good.
In the case of an hotfix...
As developer I branch from master and create an branch like hotfix/incident-name and I fixed the hole. I commit and send a PR to get my review and approvals. Also don't check "close branch after merge" checkbox. Since the hotfix needs to be merged to develop too.
Any admin user should be triggered to merge the PR. Which is no problem. After that I want to merge to develop too. As admin I know that I have to merge a hotfix to develop too, but since I have configured branch permissions, I do need to wait for approvals again.
At the moment I temporarily remove the "merge checks" prevent option from the develop branch, and merge the hotfix instantly. But that can't be the solution I think.
Is there another way to get this done more easily?
Many thanks!
Regards, Bert