Commit d867081d authored by Shinya Maeda's avatar Shinya Maeda

Simplify the query to fetch base and head pipelines

parent 394ea2f9
......@@ -1029,11 +1029,8 @@ class MergeRequest < ActiveRecord::Base
def calculate_reactive_cache(base_pipeline_iid, head_pipeline_iid)
begin
if base_pipeline_iid
base_pipeline, head_pipeline = project.pipelines.where(iid: [base_pipeline_iid, head_pipeline_iid]).all
else
head_pipeline = project.pipelines.find(iid: head_pipeline_iid)
end
base_pipeline = project.pipelines.find_by_iid(base_pipeline_iid)
head_pipeline = project.pipelines.find_by_iid(head_pipeline_iid)
comparer = Gitlab::Ci::Reports::TestReportsComparer
.new(base_pipeline&.test_reports, head_pipeline.test_reports)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment