diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 13:34:23 -0600 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 13:34:23 -0600 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /app/finders/ci/pipelines_for_merge_request_finder.rb | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) | |
download | gitlab-ce-6438df3a1e0fb944485cebf07976160184697d72.tar.gz |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'app/finders/ci/pipelines_for_merge_request_finder.rb')
-rw-r--r-- | app/finders/ci/pipelines_for_merge_request_finder.rb | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/app/finders/ci/pipelines_for_merge_request_finder.rb b/app/finders/ci/pipelines_for_merge_request_finder.rb index da8dfc2579a..1f6ee9d75ad 100644 --- a/app/finders/ci/pipelines_for_merge_request_finder.rb +++ b/app/finders/ci/pipelines_for_merge_request_finder.rb @@ -34,11 +34,7 @@ module Ci pipelines = if merge_request.persisted? - if Feature.enabled?(:ci_pipelines_for_merge_request_finder_new_cte, target_project) - pipelines_using_cte - else - pipelines_using_legacy_cte - end + pipelines_using_cte else triggered_for_branch.for_sha(commit_shas) end @@ -49,18 +45,6 @@ module Ci private - def pipelines_using_legacy_cte - cte = Gitlab::SQL::CTE.new(:shas, merge_request.all_commits.select(:sha)) - - source_sha_join = cte.table[:sha].eq(Ci::Pipeline.arel_table[:source_sha]) - merged_result_pipelines = filter_by(triggered_by_merge_request, cte, source_sha_join) - detached_merge_request_pipelines = filter_by_sha(triggered_by_merge_request, cte) - pipelines_for_branch = filter_by_sha(triggered_for_branch, cte) - - Ci::Pipeline.with(cte.to_arel) # rubocop: disable CodeReuse/ActiveRecord - .from_union([merged_result_pipelines, detached_merge_request_pipelines, pipelines_for_branch]) - end - def pipelines_using_cte cte = Gitlab::SQL::CTE.new(:shas, merge_request.all_commits.select(:sha)) |