Add project setting: prevent self-merge on protected branches
What does this MR do and why?
With the new project setting prevent_self_merge_on_protected_branch
you can prevent self-merge on protected branches via a simple
project setting. This is useful for all projects to avoid people
merging their branches by them self by accident.
DB migration up
rails db:migrate:up VERSION=20210915115207 RAILS_ENV=development
== 20210915115207 AddProjectsPreventSelfMergeOnProtectedBranch: migrating =====
-- add_column(:project_settings, :prevent_self_merge_on_protected_branch, :boolean, {:default=>false, :null=>false})
-> 0.0034s
== 20210915115207 AddProjectsPreventSelfMergeOnProtectedBranch: migrated (0.0035s)
DB migration down
rails db:migrate:down VERSION=20210915115207 RAILS_ENV=development
== 20210915115207 AddProjectsPreventSelfMergeOnProtectedBranch: reverting =====
-- remove_column(:project_settings, :prevent_self_merge_on_protected_branch)
-> 0.0032s
== 20210915115207 AddProjectsPreventSelfMergeOnProtectedBranch: reverted (0.0033s)
Screenshots or screen recordings
New project setting Prevent self-merge for protected branches
within Project->Settings->General->Merge requests->Merge checks
:
How to set up and validate locally
- Enable
Prevent self-merge for protected branches
within the project - Create MR towards a protected branch
- You are not allowed to merge
- Ask another maintainer to merge or unprotect the branch
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Roger Meier