Class: Gitlab::GithubImport::Importer::Events::Commented

Inherits:
BaseImporter
  • Object
show all
Defined in:
lib/gitlab/github_import/importer/events/commented.rb

Instance Method Summary collapse

Methods inherited from BaseImporter

#initialize

Methods included from Import::PlaceholderReferences::Pusher

#map_to_personal_namespace_owner?, #push_reference, #push_reference_with_composite_key, #push_references_by_ids, #user_mapping_enabled?

Constructor Details

This class inherits a constructor from Gitlab::GithubImport::Importer::Events::BaseImporter

Instance Method Details

#execute(issue_event) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/gitlab/github_import/importer/events/commented.rb', line 8

def execute(issue_event)
  note = Representation::Note.from_json_hash(
    noteable_id: issue_event.issuable_id,
    noteable_type: issue_event.issuable_type,
    author: issue_event.actor&.to_hash,
    note: issue_event.body,
    created_at: issue_event.created_at,
    updated_at: issue_event.updated_at,
    note_id: issue_event.id,
    imported_from: imported_from
  )

  NoteImporter.new(note, project, client).execute
end