diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-29 15:06:40 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-29 15:06:40 +0300 |
commit | d64e3a8b281d355c7d51d04df52fab407b8cc76d (patch) | |
tree | 282d6cc62eacd3fb4a0f6841ae52ae4a709e303f /app/services | |
parent | 833eadad8cac85b99871842854c9a676a607e2da (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/merge_requests/refresh_service.rb | 7 | ||||
-rw-r--r-- | app/services/preview_markdown_service.rb | 10 | ||||
-rw-r--r-- | app/services/quick_actions/target_service.rb | 2 |
3 files changed, 14 insertions, 5 deletions
diff --git a/app/services/merge_requests/refresh_service.rb b/app/services/merge_requests/refresh_service.rb index b32499629ff..bd3fcf85a62 100644 --- a/app/services/merge_requests/refresh_service.rb +++ b/app/services/merge_requests/refresh_service.rb @@ -152,7 +152,8 @@ module MergeRequests def abort_ff_merge_requests_with_when_pipeline_succeeds return unless @project.ff_merge_must_be_possible? - requests_with_auto_merge_enabled_to(@push.branch_name).each do |merge_request| + merge_requests_with_auto_merge_enabled_to(@push.branch_name).each do |merge_request| + next unless merge_request.auto_merge_strategy == AutoMergeService::STRATEGY_MERGE_WHEN_PIPELINE_SUCCEEDS next unless merge_request.should_be_rebased? abort_auto_merge_with_todo(merge_request, 'target branch was updated') @@ -167,11 +168,11 @@ module MergeRequests todo_service.merge_request_became_unmergeable(merge_request) end - def requests_with_auto_merge_enabled_to(target_branch) + def merge_requests_with_auto_merge_enabled_to(target_branch) @project .merge_requests .by_target_branch(target_branch) - .with_open_merge_when_pipeline_succeeds + .with_auto_merge_enabled end def mark_pending_todos_done diff --git a/app/services/preview_markdown_service.rb b/app/services/preview_markdown_service.rb index 2b4c4ae68e2..afe2651b11a 100644 --- a/app/services/preview_markdown_service.rb +++ b/app/services/preview_markdown_service.rb @@ -16,8 +16,12 @@ class PreviewMarkdownService < BaseService private + def quick_action_types + %w(Issue MergeRequest Commit) + end + def explain_quick_actions(text) - return text, [] unless %w(Issue MergeRequest Commit).include?(target_type) + return text, [] unless quick_action_types.include?(target_type) quick_actions_service = QuickActions::InterpretService.new(project, current_user) quick_actions_service.explain(text, find_commands_target) @@ -51,7 +55,7 @@ class PreviewMarkdownService < BaseService def find_commands_target QuickActions::TargetService - .new(project, current_user) + .new(project, current_user, group: params[:group]) .execute(target_type, target_id) end @@ -63,3 +67,5 @@ class PreviewMarkdownService < BaseService params[:target_id] end end + +PreviewMarkdownService.prepend_if_ee('EE::PreviewMarkdownService') diff --git a/app/services/quick_actions/target_service.rb b/app/services/quick_actions/target_service.rb index 69464c3c1ae..4273acfbf8b 100644 --- a/app/services/quick_actions/target_service.rb +++ b/app/services/quick_actions/target_service.rb @@ -32,3 +32,5 @@ module QuickActions end end end + +QuickActions::TargetService.prepend_if_ee('EE::QuickActions::TargetService') |