Открыть боковую панель
nt_test121
nt_project_o05vkt1w9peb
Коммиты
0a5bce6e
Коммит
0a5bce6e
создал
Сен 11, 2019
по автору
Can Eldem
Зафиксировано автором
Rémy Coutable
Сен 11, 2019
Просмотр файлов
Backport changes for 16252 in EE add current_user to report comparison services
владелец
f95857c8
Изменения
2
Скрыть пробелы
Построчно
Рядом
app/models/merge_request.rb
Просмотр файла @
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
Просмотр файла @
0a5bce6e
...
...
@@ -41,7 +41,7 @@ module Ci
end
def
serializer_params
{
project:
project
}
{
project:
project
,
current_user:
current_user
}
end
def
get_report
(
pipeline
)
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать