Class: Gitlab::GithubImport::Importer::ReplayEventsImporter

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/github_import/importer/replay_events_importer.rb

Constant Summary collapse

SUPPORTED_EVENTS =
%w[review_request_removed review_requested].freeze

Instance Method Summary collapse

Constructor Details

#initialize(replay_event, project, client) ⇒ ReplayEventsImporter

replay_event - An instance of ‘Gitlab::GithubImport::Representation::ReplayEvent`. project - An instance of `Project` client - An instance of `Gitlab::GithubImport::Client`



12
13
14
15
16
# File 'lib/gitlab/github_import/importer/replay_events_importer.rb', line 12

def initialize(replay_event, project, client)
  @project = project
  @client = client
  @replay_event = replay_event
end

Instance Method Details

#executeObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/gitlab/github_import/importer/replay_events_importer.rb', line 18

def execute
  association = case replay_event.issuable_type
                when 'MergeRequest'
                  project.merge_requests.find_by_iid(replay_event.issuable_iid)
                end

  return unless association

  events_cache = EventsCache.new(project)

  handle_review_requests(association, events_cache.events(association))

  events_cache.delete(association)
end