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
0a5bce6e
Commit
0a5bce6e
authored
Sep 11, 2019
by
Can Eldem
Committed by
Rémy Coutable
Sep 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport changes for 16252 in EE add current_user to report comparison services
parent
f95857c8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
app/models/merge_request.rb
app/models/merge_request.rb
+4
-3
app/services/ci/compare_reports_base_service.rb
app/services/ci/compare_reports_base_service.rb
+1
-1
No files found.
app/models/merge_request.rb
View file @
0a5bce6e
...
...
@@ -1239,7 +1239,7 @@ class MergeRequest < ApplicationRecord
end
def
compare_reports
(
service_class
,
current_user
=
nil
)
with_reactive_cache
(
service_class
.
name
)
do
|
data
|
with_reactive_cache
(
service_class
.
name
,
current_user
&
.
id
)
do
|
data
|
unless
service_class
.
new
(
project
,
current_user
)
.
latest?
(
base_pipeline
,
actual_head_pipeline
,
data
)
raise
InvalidateReactiveCache
...
...
@@ -1249,12 +1249,13 @@ class MergeRequest < ApplicationRecord
end
||
{
status: :parsing
}
end
def
calculate_reactive_cache
(
identifier
,
*
args
)
def
calculate_reactive_cache
(
identifier
,
current_user_id
=
nil
,
*
args
)
service_class
=
identifier
.
constantize
raise
NameError
,
service_class
unless
service_class
<
Ci
::
CompareReportsBaseService
service_class
.
new
(
project
).
execute
(
base_pipeline
,
actual_head_pipeline
)
current_user
=
User
.
find_by
(
id:
current_user_id
)
service_class
.
new
(
project
,
current_user
).
execute
(
base_pipeline
,
actual_head_pipeline
)
end
def
all_commits
...
...
app/services/ci/compare_reports_base_service.rb
View file @
0a5bce6e
...
...
@@ -41,7 +41,7 @@ module Ci
end
def
serializer_params
{
project:
project
}
{
project:
project
,
current_user:
current_user
}
end
def
get_report
(
pipeline
)
...
...
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