Method: MergeRequest#calculate_reactive_cache

Defined in:
app/models/merge_request.rb

#calculate_reactive_cache(identifier, current_user_id = nil, report_type = nil, *args) ⇒ Object

Raises:

  • (NameError)


2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
# File 'app/models/merge_request.rb', line 2244

def calculate_reactive_cache(identifier, current_user_id = nil, report_type = nil, *args)
  service_class = identifier.constantize

  # TODO: the type check should change to something that includes exposed artifacts service
  # issue: https://gitlab.com/gitlab-org/gitlab/issues/34224
  raise NameError, service_class unless service_class < Ci::CompareReportsBaseService

  current_user = User.find_by(id: current_user_id)
  service_class.new(project, current_user, id: id, report_type: report_type).execute(comparison_base_pipeline(service_class), diff_head_pipeline)
end