summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2018-09-24 12:02:43 +0200
committerJames Lopez <james@jameslopez.es>2018-09-24 12:02:43 +0200
commit6691194af979d87b9afca7c053af438c904f4af9 (patch)
tree95b3757550b173fe7e869f49e66a7cdcd00f9fd7
parent6e641789fcfa9d380344a8ae3fdba36605acc050 (diff)
downloadgitlab-ce-51747-gitlab-com-unable-to-import-a-project-that-was-just-exported.tar.gz
-rw-r--r--changelogs/unreleased/51747-gitlab-com-unable-to-import-a-project-that-was-just-exported.yml5
-rw-r--r--spec/lib/gitlab/import_export/project.json1
-rw-r--r--spec/lib/gitlab/import_export/project_tree_restorer_spec.rb4
3 files changed, 10 insertions, 0 deletions
diff --git a/changelogs/unreleased/51747-gitlab-com-unable-to-import-a-project-that-was-just-exported.yml b/changelogs/unreleased/51747-gitlab-com-unable-to-import-a-project-that-was-just-exported.yml
new file mode 100644
index 00000000000..29f7fd872bc
--- /dev/null
+++ b/changelogs/unreleased/51747-gitlab-com-unable-to-import-a-project-that-was-just-exported.yml
@@ -0,0 +1,5 @@
+---
+title: Fix NULL pipeline import problem and pipeline user mapping issue
+merge_request: 21875
+author:
+type: fixed
diff --git a/spec/lib/gitlab/import_export/project.json b/spec/lib/gitlab/import_export/project.json
index 06e0449205d..3f2281f213f 100644
--- a/spec/lib/gitlab/import_export/project.json
+++ b/spec/lib/gitlab/import_export/project.json
@@ -6154,6 +6154,7 @@
"status": "failed",
"started_at": null,
"finished_at": null,
+ "user_id": 9999,
"duration": null,
"notes": [
{
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 d44cfc6cc8f..7ebfc61f5e7 100644
--- a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
+++ b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
@@ -62,6 +62,10 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
expect(Ci::Pipeline.find_by_sha('sha-notes').notes).not_to be_empty
end
+ it 'pipeline has the correct user ID' do
+ expect(Ci::Pipeline.find_by_sha('sha-notes').user_id).to eq(@user.id)
+ end
+
it 'restores pipelines with missing ref' do
expect(Ci::Pipeline.where(ref: nil)).not_to be_empty
end