Commit 3d7eb109 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'georgekoltsov/add-epics-activity-to-group-export' into 'master'

Add Epics Activity info to Group Export

Closes #198523

See merge request gitlab-org/gitlab!23613
parents 0e9fa160 c6714fb9
---
title: Add Epics Activity information to Group Export
merge_request: 23613
author:
type: changed
...@@ -9,8 +9,11 @@ describe Gitlab::ImportExport::GroupTreeSaver do ...@@ -9,8 +9,11 @@ describe Gitlab::ImportExport::GroupTreeSaver do
let_it_be(:label) { create(:group_label) } let_it_be(:label) { create(:group_label) }
let_it_be(:parent_epic) { create(:epic, group: group) } let_it_be(:parent_epic) { create(:epic, group: group) }
let_it_be(:epic) { create(:epic, group: group, parent: parent_epic) } let_it_be(:epic) { create(:epic, group: group, parent: parent_epic) }
let_it_be(:epic_event) { create(:event, :created, target: epic, group: group, author: user) }
let_it_be(:epic_push_event) { create(:event, :pushed, target: epic, group: group, author: user) }
let_it_be(:board) { create(:board, group: group, assignee: user, labels: [label]) } let_it_be(:board) { create(:board, group: group, assignee: user, labels: [label]) }
let_it_be(:note) { create(:note, noteable: epic) } let_it_be(:note) { create(:note, noteable: epic) }
let_it_be(:note_event) { create(:event, :created, target: note, author: user) }
let(:shared) { Gitlab::ImportExport::Shared.new(group) } let(:shared) { Gitlab::ImportExport::Shared.new(group) }
let(:export_path) { "#{Dir.tmpdir}/group_tree_saver_spec_ee" } let(:export_path) { "#{Dir.tmpdir}/group_tree_saver_spec_ee" }
...@@ -62,6 +65,23 @@ describe Gitlab::ImportExport::GroupTreeSaver do ...@@ -62,6 +65,23 @@ describe Gitlab::ImportExport::GroupTreeSaver do
expect(notes.first['note']).to eq(note.note) expect(notes.first['note']).to eq(note.note)
expect(notes.first['noteable_id']).to eq(epic.id) expect(notes.first['noteable_id']).to eq(epic.id)
end end
it 'saves epic events' do
expect_successful_save(group_tree_saver)
events = epic_json['events']
expect(events).not_to be_empty
event_actions = events.map { |event| event['action'] }
expect(event_actions).to contain_exactly(epic_event.action, epic_push_event.action)
end
it "saves epic's note events" do
expect_successful_save(group_tree_saver)
notes = epic_json['notes']
expect(notes.first['events'].first['action']).to eq(note_event.action)
end
end end
context 'boards relation' do context 'boards relation' do
......
...@@ -34,6 +34,8 @@ methods: ...@@ -34,6 +34,8 @@ methods:
- :type - :type
notes: notes:
- :type - :type
events:
- :action
preloads: preloads:
...@@ -44,8 +46,12 @@ ee: ...@@ -44,8 +46,12 @@ ee:
group: group:
- epics: - epics:
- :parent - :parent
- events:
- :push_event_payload
- notes: - notes:
- :author - :author
- events:
- :push_event_payload
- boards: - boards:
- :board_assignee - :board_assignee
- labels: - labels:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment