Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
95bda4ee
Commit
95bda4ee
authored
Mar 24, 2020
by
drew cimino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Ci::Pipeline#merge_request as the merge request for all builds
parent
1e43b047
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
app/models/ci/build.rb
app/models/ci/build.rb
+1
-7
changelogs/unreleased/update-ci-build-merge-request.yml
changelogs/unreleased/update-ci-build-merge-request.yml
+5
-0
No files found.
app/models/ci/build.rb
View file @
95bda4ee
...
...
@@ -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
...
...
changelogs/unreleased/update-ci-build-merge-request.yml
0 → 100644
View file @
95bda4ee
---
title
:
Use Ci::Pipeline#all_merge_requests.first as Ci::Build#merge_request
merge_request
:
27968
author
:
type
:
fixed
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment