diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-01 21:12:39 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-01 21:12:39 +0300 |
commit | 68ce709bef9bc89bbb9869e24508777bbe0a1a1d (patch) | |
tree | 65dc0fd3693312debb7f40586c5682162081dc6c /app/services/auto_merge | |
parent | b21334799a5226cdef52d4fb3b148f08af209f1a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/auto_merge')
-rw-r--r-- | app/services/auto_merge/base_service.rb | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/app/services/auto_merge/base_service.rb b/app/services/auto_merge/base_service.rb index d0fde43138a..467a4ed2621 100644 --- a/app/services/auto_merge/base_service.rb +++ b/app/services/auto_merge/base_service.rb @@ -61,15 +61,19 @@ module AutoMerge merge_request.can_be_merged_by?(current_user) && merge_request.open? && !merge_request.broken? && - (skip_draft_check(merge_request) || !merge_request.draft?) && - (skip_discussions_check(merge_request) || merge_request.mergeable_discussions_state?) && - (skip_blocked_check(merge_request) || !merge_request.merge_blocked_by_other_mrs?) && + overrideable_available_for_checks(merge_request) && yield end end private + def overrideable_available_for_checks(merge_request) + !merge_request.draft? && + merge_request.mergeable_discussions_state? && + !merge_request.merge_blocked_by_other_mrs? + end + # Overridden in child classes def notify(merge_request) end @@ -109,20 +113,5 @@ module AutoMerge def track_exception(error, merge_request) Gitlab::ErrorTracking.track_exception(error, merge_request_id: merge_request&.id) end - - # Will skip the draft check or not when checking if strategy is available - def skip_draft_check(merge_request) - false - end - - # Will skip the blocked check or not when checking if strategy is available - def skip_blocked_check(merge_request) - false - end - - # Will skip the discussions check or not when checking if strategy is available - def skip_discussions_check(merge_request) - false - end end end |