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
52eda263
Commit
52eda263
authored
Sep 28, 2021
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Explicitly limit SHAs in PipelinesForMergeRequestFinder
parent
ed830ef5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
app/finders/ci/pipelines_for_merge_request_finder.rb
app/finders/ci/pipelines_for_merge_request_finder.rb
+8
-1
No files found.
app/finders/ci/pipelines_for_merge_request_finder.rb
View file @
52eda263
...
...
@@ -5,6 +5,8 @@ module Ci
class
PipelinesForMergeRequestFinder
include
Gitlab
::
Utils
::
StrongMemoize
COMMITS_LIMIT
=
100
def
initialize
(
merge_request
,
current_user
)
@merge_request
=
merge_request
@current_user
=
current_user
...
...
@@ -12,7 +14,7 @@ module Ci
attr_reader
:merge_request
,
:current_user
delegate
:
recent_diff_head_sha
s
,
:commit_shas
,
:target_project
,
:source_project
,
:source_branch
,
to: :merge_request
delegate
:
merge_request_diff
s
,
:commit_shas
,
:target_project
,
:source_project
,
:source_branch
,
to: :merge_request
# Fetch all pipelines that the user can read.
def
execute
...
...
@@ -90,6 +92,11 @@ module Ci
end
end
def
recent_diff_head_shas
# We're limiting the number of commits' SHAs to 100 since they are used in a WHERE clause of a query
merge_request_diffs
.
recent
.
limit
(
COMMITS_LIMIT
).
pluck
(
:head_commit_sha
).
uniq
# rubocop: disable CodeReuse/ActiveRecord
end
# NOTE: this method returns only parent merge request pipelines.
# Child merge request pipelines have a different source.
def
triggered_by_merge_request
...
...
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