From 3111d6a9cc814e43a0ca232f586c244ef79dc8bd Mon Sep 17 00:00:00 2001
From: James Lopez <james@jameslopez.es>
Date: Fri, 2 Sep 2016 16:52:11 +0200
Subject: [PATCH] Fixed gitlab.com importer missing confidential attribute

---
 CHANGELOG                                      | 1 +
 lib/gitlab/gitlab_import/importer.rb           | 3 ++-
 spec/lib/gitlab/gitlab_import/importer_spec.rb | 2 ++
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG b/CHANGELOG
index bc18171d09182..29a8d8bba844f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -87,6 +87,7 @@ v 8.11.5 (unreleased)
   - Fix member expiration date picker after update
   - Fix suggested colors options for new labels in the admin area. !6138
   - Fix GitLab import button
+  - Fix confidential issues being exposed as public using gitlab.com export
 
 v 8.11.4
   - Fix resolving conflicts on forks. !6082
diff --git a/lib/gitlab/gitlab_import/importer.rb b/lib/gitlab/gitlab_import/importer.rb
index 46d40f75be6b9..cc49d6aac5cb7 100644
--- a/lib/gitlab/gitlab_import/importer.rb
+++ b/lib/gitlab/gitlab_import/importer.rb
@@ -41,7 +41,8 @@ def execute
               title: issue["title"],
               state: issue["state"],
               updated_at: issue["updated_at"],
-              author_id: gl_user_id(project, issue["author"]["id"])
+              author_id: gl_user_id(project, issue["author"]["id"]),
+              confidential: issue["confidential"]
             )
           end
         end
diff --git a/spec/lib/gitlab/gitlab_import/importer_spec.rb b/spec/lib/gitlab/gitlab_import/importer_spec.rb
index d3f1deb383765..9b499b593d32c 100644
--- a/spec/lib/gitlab/gitlab_import/importer_spec.rb
+++ b/spec/lib/gitlab/gitlab_import/importer_spec.rb
@@ -13,6 +13,7 @@
           'title' => 'Issue',
           'description' => 'Lorem ipsum',
           'state' => 'opened',
+          'confidential' => true,
           'author' => {
             'id' => 283999,
             'name' => 'John Doe'
@@ -34,6 +35,7 @@
         title: 'Issue',
         description: "*Created by: John Doe*\n\nLorem ipsum",
         state: 'opened',
+        confidential: true,
         author_id: project.creator_id
       }
 
-- 
GitLab