diff options
author | Rodolfo Santos <rodolfoasantos@gmail.com> | 2016-09-16 14:02:42 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-11-04 16:58:40 +0300 |
commit | 1db9f826c16053e32a1d234bf40b2ca399779cdf (patch) | |
tree | 114a255d1269ed0118fa741f6cbbeb113f0de838 /app/models/merge_request.rb | |
parent | a3cc2f1e8dfcfb2f3e181fa570ed2ba245f9a069 (diff) |
Add setting to only allow merge requests to be merged when all discussions are resolved
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/models/merge_request.rb')
-rw-r--r-- | app/models/merge_request.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 6b8ac3fb48b..d76feb9680e 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -425,6 +425,7 @@ class MergeRequest < ActiveRecord::Base return false if work_in_progress? return false if broken? return false unless skip_ci_check || mergeable_ci_state? + return false unless mergeable_discussions_state? true end @@ -493,6 +494,12 @@ class MergeRequest < ActiveRecord::Base discussions_resolvable? && diff_discussions.none?(&:to_be_resolved?) end + def mergeable_discussions_state? + return true unless project.only_allow_merge_if_all_discussions_are_resolved? + + discussions_resolved? + end + def hook_attrs attrs = { source: source_project.try(:hook_attrs), |