diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 01:45:44 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 01:45:44 +0000 |
commit | 85dc423f7090da0a52c73eb66faf22ddb20efff9 (patch) | |
tree | 9160f299afd8c80c038f08e1545be119f5e3f1e1 /app/services/auto_merge | |
parent | 15c2c8c66dbe422588e5411eee7e68f1fa440bb8 (diff) | |
download | gitlab-ce-85dc423f7090da0a52c73eb66faf22ddb20efff9.tar.gz |
Add latest changes from gitlab-org/gitlab@13-4-stable-ee
Diffstat (limited to 'app/services/auto_merge')
-rw-r--r-- | app/services/auto_merge/base_service.rb | 15 | ||||
-rw-r--r-- | app/services/auto_merge/merge_when_pipeline_succeeds_service.rb | 2 |
2 files changed, 15 insertions, 2 deletions
diff --git a/app/services/auto_merge/base_service.rb b/app/services/auto_merge/base_service.rb index 5c63dc34cb1..41236286d23 100644 --- a/app/services/auto_merge/base_service.rb +++ b/app/services/auto_merge/base_service.rb @@ -60,6 +60,21 @@ module AutoMerge end end + ## + # NOTE: This method is to be removed when `disallow_to_create_merge_request_pipelines_in_target_project` + # feature flag is removed. + def self.can_add_to_merge_train?(merge_request) + if Gitlab::Ci::Features.disallow_to_create_merge_request_pipelines_in_target_project?(merge_request.target_project) + merge_request.for_same_project? + else + true + end + end + + def can_add_to_merge_train?(merge_request) + self.class.can_add_to_merge_train?(merge_request) + end + private # Overridden in child classes diff --git a/app/services/auto_merge/merge_when_pipeline_succeeds_service.rb b/app/services/auto_merge/merge_when_pipeline_succeeds_service.rb index 7e0298432ac..d18f2935d92 100644 --- a/app/services/auto_merge/merge_when_pipeline_succeeds_service.rb +++ b/app/services/auto_merge/merge_when_pipeline_succeeds_service.rb @@ -38,8 +38,6 @@ module AutoMerge private def notify(merge_request) - return unless Feature.enabled?(:mwps_notification, project) - notification_service.async.merge_when_pipeline_succeeds(merge_request, current_user) if merge_request.saved_change_to_auto_merge_enabled? end end |