From ef8217fbeee55c02b6bab3a8b273f8ffeaa21f74 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Tue, 31 Oct 2017 12:56:16 +0100 Subject: fix missing issue assignees --- lib/gitlab/import_export/import_export.yml | 1 + spec/lib/gitlab/import_export/project.json | 8 +++++++- spec/lib/gitlab/import_export/project_tree_restorer_spec.rb | 4 ++++ spec/lib/gitlab/import_export/project_tree_saver_spec.rb | 4 ++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/gitlab/import_export/import_export.yml b/lib/gitlab/import_export/import_export.yml index dec8b4c5acd..e68761066d8 100644 --- a/lib/gitlab/import_export/import_export.yml +++ b/lib/gitlab/import_export/import_export.yml @@ -19,6 +19,7 @@ project_tree: - milestone: - events: - :push_event_payload + - :issue_assignees - snippets: - :award_emoji - notes: diff --git a/spec/lib/gitlab/import_export/project.json b/spec/lib/gitlab/import_export/project.json index 1115fb218d6..4eb8afc08e3 100644 --- a/spec/lib/gitlab/import_export/project.json +++ b/spec/lib/gitlab/import_export/project.json @@ -43,7 +43,7 @@ "issues": [ { "id": 40, - "title": "Voluptatem amet doloribus deleniti eos maxime repudiandae molestias.", + "title": "Voluptatem", "assignee_id": 1, "author_id": 22, "project_id": 5, @@ -70,6 +70,12 @@ "updated_at": "2016-06-14T15:02:04.415Z", "state": "active", "iid": 1, + "issue_assignees": [ + { + "user_id": 1, + "issue_id": 1 + } + ] "events": [ { "id": 487, diff --git a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb index 4301eee17dc..a8eac318242 100644 --- a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb @@ -63,6 +63,10 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do expect(issue.reload.updated_at.to_s).to eq('2016-06-14 15:02:47 UTC') end + it 'has issue assignees' do + expect(project.issues.where(title: 'Voluptatem').first.issue_assignees).not_to be_empty + end + it 'contains the merge access levels on a protected branch' do expect(ProtectedBranch.first.merge_access_levels).not_to be_empty end diff --git a/spec/lib/gitlab/import_export/project_tree_saver_spec.rb b/spec/lib/gitlab/import_export/project_tree_saver_spec.rb index d9b86e1bf34..8da768ebd07 100644 --- a/spec/lib/gitlab/import_export/project_tree_saver_spec.rb +++ b/spec/lib/gitlab/import_export/project_tree_saver_spec.rb @@ -77,6 +77,10 @@ describe Gitlab::ImportExport::ProjectTreeSaver do expect(saved_project_json['issues'].first['notes']).not_to be_empty end + it 'has issue assignees' do + expect(saved_project_json['issues'].first['issue_assignees']).not_to be_empty + end + it 'has author on issue comments' do expect(saved_project_json['issues'].first['notes'].first['author']).not_to be_empty end -- cgit v1.2.1 From 4bce563c6b66cffd87cd32921214148d4de541e0 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Tue, 31 Oct 2017 14:26:51 +0100 Subject: fix specs --- spec/lib/gitlab/import_export/project.json | 12 ++++++------ spec/lib/gitlab/import_export/project_tree_restorer_spec.rb | 2 +- spec/lib/gitlab/import_export/safe_model_attributes.yml | 3 +++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/spec/lib/gitlab/import_export/project.json b/spec/lib/gitlab/import_export/project.json index 4eb8afc08e3..9a68bbb379c 100644 --- a/spec/lib/gitlab/import_export/project.json +++ b/spec/lib/gitlab/import_export/project.json @@ -60,6 +60,12 @@ "due_date": null, "moved_to_id": null, "test_ee_field": "test", + "issue_assignees": [ + { + "user_id": 1, + "issue_id": 1 + } + ], "milestone": { "id": 1, "title": "test milestone", @@ -70,12 +76,6 @@ "updated_at": "2016-06-14T15:02:04.415Z", "state": "active", "iid": 1, - "issue_assignees": [ - { - "user_id": 1, - "issue_id": 1 - } - ] "events": [ { "id": 487, diff --git a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb index a8eac318242..76b01b6a1ec 100644 --- a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb @@ -64,7 +64,7 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do end it 'has issue assignees' do - expect(project.issues.where(title: 'Voluptatem').first.issue_assignees).not_to be_empty + expect(Issue.where(title: 'Voluptatem').first.issue_assignees).not_to be_empty end it 'contains the merge access levels on a protected branch' do diff --git a/spec/lib/gitlab/import_export/safe_model_attributes.yml b/spec/lib/gitlab/import_export/safe_model_attributes.yml index 121c0ed04ed..89d30407077 100644 --- a/spec/lib/gitlab/import_export/safe_model_attributes.yml +++ b/spec/lib/gitlab/import_export/safe_model_attributes.yml @@ -506,3 +506,6 @@ ProjectAutoDevops: - project_id - created_at - updated_at +IssueAssignee: +- user_id +- issue_id \ No newline at end of file -- cgit v1.2.1 From 3a887c92d066b24afa64968bf67dfae97edb63a4 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Tue, 31 Oct 2017 16:13:09 +0100 Subject: fix spec failure --- spec/lib/gitlab/import_export/all_models.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml index 29baa70d5ae..f5f48c47520 100644 --- a/spec/lib/gitlab/import_export/all_models.yml +++ b/spec/lib/gitlab/import_export/all_models.yml @@ -286,3 +286,6 @@ timelogs: - user push_event_payload: - event +issue_assignees: +- issue +- assignee \ No newline at end of file -- cgit v1.2.1 From da17419418f9339cb4e8c790350d7198ce2d5546 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Tue, 31 Oct 2017 16:29:39 +0100 Subject: add changelog --- changelogs/unreleased/fix-import-issue-assignees.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelogs/unreleased/fix-import-issue-assignees.yml diff --git a/changelogs/unreleased/fix-import-issue-assignees.yml b/changelogs/unreleased/fix-import-issue-assignees.yml new file mode 100644 index 00000000000..063b6afaf08 --- /dev/null +++ b/changelogs/unreleased/fix-import-issue-assignees.yml @@ -0,0 +1,5 @@ +--- +title: Fix missing Import/Export issue assignees +merge_request: +author: +type: fixed -- cgit v1.2.1