Commit 95bda4ee authored by drew cimino's avatar drew cimino

Use Ci::Pipeline#merge_request as the merge request for all builds

parent 1e43b047
......@@ -591,13 +591,7 @@ module Ci
def merge_request
strong_memoize(:merge_request) do
merge_requests = MergeRequest.includes(:latest_merge_request_diff)
.where(source_branch: ref, source_project: pipeline.project)
.reorder(iid: :desc)
merge_requests.find do |merge_request|
merge_request.commit_shas.include?(pipeline.sha)
end
pipeline.all_merge_requests.first
end
end
......
---
title: Use Ci::Pipeline#all_merge_requests.first as Ci::Build#merge_request
merge_request: 27968
author:
type: fixed
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