Commit f93d656d authored by James Lopez's avatar James Lopez

Merge branch 'georgekoltsov/fix-epic-issues' into 'master'

Fix issues missing on epic's page after project import

See merge request gitlab-org/gitlab!26099
parents 866e3b96 b9b41ff5
---
title: Fix issues missing on epic's page after project import
merge_request: 26099
author:
type: fixed
......@@ -18,6 +18,7 @@ describe Gitlab::ImportExport::Project::TreeRestorer do
end
context 'with group' do
let(:issue) { project.issues.find_by_title('Issue with Epic') }
let!(:project) do
create(:project,
:builds_disabled,
......@@ -35,7 +36,8 @@ describe Gitlab::ImportExport::Project::TreeRestorer do
expect { restored_project_json }.not_to change { Epic.count }
expect(project.group.epics.count).to eq(1)
expect(project.issues.find_by_title('Issue with Epic').epic).not_to be_nil
expect(issue.epic).to eq(epic)
expect(issue.epic_issue.relative_position).not_to be_nil
end
end
......@@ -45,7 +47,9 @@ describe Gitlab::ImportExport::Project::TreeRestorer do
expect { restored_project_json }.to change { Epic.count }.from(0).to(1)
expect(project.group.epics.count).to eq(1)
expect(project.issues.find_by_title('Issue with Epic').epic).not_to be_nil
expect(issue.epic).not_to be_nil
expect(issue.epic_issue.relative_position).not_to be_nil
end
end
end
......
......@@ -60,12 +60,21 @@ describe Gitlab::ImportExport::Project::TreeSaver do
end
context 'epics' do
it 'has issue epic' do
expect(saved_project_json['issues'].first['epic']).not_to be_empty
it 'has epic_issue' do
expect(saved_project_json['issues'].first['epic_issue']).not_to be_empty
expect(saved_project_json['issues'].first['epic_issue']['id']).to eql(epic_issue.id)
end
it 'has issue epic id' do
expect(saved_project_json['issues'].first['epic']['id']).to eql(epic.id)
it 'has epic' do
expect(saved_project_json['issues'].first['epic_issue']['epic']['title']).to eql(epic.title)
end
it 'does not have epic_id' do
expect(saved_project_json['issues'].first['epic_issue']['epic_id']).to be_nil
end
it 'does not have issue_id' do
expect(saved_project_json['issues'].first['epic_issue']['issue_id']).to be_nil
end
end
end
......
......@@ -319,6 +319,9 @@ excluded_attributes:
- :state_id
- :start_date_sourcing_epic_id
- :due_date_sourcing_epic_id
epic_issue:
- :epic_id
- :issue_id
methods:
notes:
- :type
......@@ -371,6 +374,7 @@ ee:
- design_versions:
- actions:
- :design # Duplicate export of issues.designs in order to link the record to both Issue and Action
- epic_issue:
- :epic
- protected_branches:
- :unprotect_access_levels
......
......@@ -205,6 +205,9 @@
"iid": 1,
"group_id": 100
},
"epic_issue": {
"id": 78,
"relative_position": 1073740323,
"epic": {
"id": 1,
"group_id": 5,
......@@ -237,6 +240,7 @@
"milestone_id": null
}
}
}
],
"snippets": [
......
......@@ -609,3 +609,6 @@ epic:
- events
- resource_label_events
- user_mentions
epic_issue:
- epic
- issue
......@@ -832,3 +832,6 @@ Epic:
- start_date_sourcing_epic_id
- due_date_sourcing_epic_id
- health_status
EpicIssue:
- id
- relative_position
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