summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-03-14 14:17:35 +0000
committerTiago Botelho <tiagonbotelho@hotmail.com>2018-03-16 13:56:11 +0000
commit5248e37f27fe7afaec40b61041e9fa9fe70b2952 (patch)
treefe0edd37357f2a110bac4bf0fd6adc2255cbb998 /app
parenta63d74709be2af852e3c98505a18664e6bca9754 (diff)
downloadgitlab-ce-5248e37f27fe7afaec40b61041e9fa9fe70b2952.tar.gz
Adds the option to override project description on export via API
and fixes the project description not being imported
Diffstat (limited to 'app')
-rw-r--r--app/models/project.rb4
-rw-r--r--app/services/projects/import_export/export_service.rb2
-rw-r--r--app/workers/project_export_worker.rb5
3 files changed, 6 insertions, 5 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index a291ad7eed5..5487194ed3e 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1519,8 +1519,8 @@ class Project < ActiveRecord::Base
@errors = original_errors
end
- def add_export_job(current_user:)
- job_id = ProjectExportWorker.perform_async(current_user.id, self.id)
+ def add_export_job(current_user:, params: {})
+ job_id = ProjectExportWorker.perform_async(current_user.id, self.id, params)
if job_id
Rails.logger.info "Export job started for project ID #{self.id} with job ID #{job_id}"
diff --git a/app/services/projects/import_export/export_service.rb b/app/services/projects/import_export/export_service.rb
index af41ce82f65..d16aa3de639 100644
--- a/app/services/projects/import_export/export_service.rb
+++ b/app/services/projects/import_export/export_service.rb
@@ -26,7 +26,7 @@ module Projects
end
def project_tree_saver
- Gitlab::ImportExport::ProjectTreeSaver.new(project: project, current_user: @current_user, shared: @shared)
+ Gitlab::ImportExport::ProjectTreeSaver.new(project: project, current_user: @current_user, shared: @shared, params: @params)
end
def uploads_saver
diff --git a/app/workers/project_export_worker.rb b/app/workers/project_export_worker.rb
index c100852374a..0b502143e5d 100644
--- a/app/workers/project_export_worker.rb
+++ b/app/workers/project_export_worker.rb
@@ -4,10 +4,11 @@ class ProjectExportWorker
sidekiq_options retry: 3
- def perform(current_user_id, project_id)
+ def perform(current_user_id, project_id, params = {})
+ params = params.with_indifferent_access
current_user = User.find(current_user_id)
project = Project.find(project_id)
- ::Projects::ImportExport::ExportService.new(project, current_user).execute
+ ::Projects::ImportExport::ExportService.new(project, current_user, params).execute
end
end