diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-08-11 10:28:42 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-08-11 10:28:42 +0200 |
commit | 9f10943c1a76576ac40d96189a28a4d6123a75d8 (patch) | |
tree | 88955d92ebc98a4165d66a36cb8a2cf92709981a /app/workers | |
parent | 84727fba96c6794874e1f94d581408b70e1842a7 (diff) | |
download | gitlab-ce-9f10943c1a76576ac40d96189a28a4d6123a75d8.tar.gz |
Revert "Merge branch 'drop-satellites'"
This reverts commit 957e849f41d96fa9778fcdd06792d2f0274b29ab, reversing
changes made to 6b9dbe9f5a175a8162abf296367f561bab3eea1a.
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/auto_merge_worker.rb | 13 | ||||
-rw-r--r-- | app/workers/merge_worker.rb | 19 | ||||
-rw-r--r-- | app/workers/repository_import_worker.rb | 1 |
3 files changed, 14 insertions, 19 deletions
diff --git a/app/workers/auto_merge_worker.rb b/app/workers/auto_merge_worker.rb new file mode 100644 index 00000000000..a6dd73eee5f --- /dev/null +++ b/app/workers/auto_merge_worker.rb @@ -0,0 +1,13 @@ +class AutoMergeWorker + include Sidekiq::Worker + + sidekiq_options queue: :default + + def perform(merge_request_id, current_user_id, params) + params = params.with_indifferent_access + current_user = User.find(current_user_id) + merge_request = MergeRequest.find(merge_request_id) + merge_request.should_remove_source_branch = params[:should_remove_source_branch] + merge_request.automerge!(current_user, params[:commit_message]) + end +end diff --git a/app/workers/merge_worker.rb b/app/workers/merge_worker.rb deleted file mode 100644 index 6a8665c179a..00000000000 --- a/app/workers/merge_worker.rb +++ /dev/null @@ -1,19 +0,0 @@ -class MergeWorker - include Sidekiq::Worker - - sidekiq_options queue: :default - - def perform(merge_request_id, current_user_id, params) - params = params.with_indifferent_access - current_user = User.find(current_user_id) - merge_request = MergeRequest.find(merge_request_id) - - result = MergeRequests::MergeService.new(merge_request.target_project, current_user). - execute(merge_request, params[:commit_message]) - - if result[:status] == :success && params[:should_remove_source_branch].present? - DeleteBranchService.new(merge_request.source_project, current_user). - execute(merge_request.source_branch) - end - end -end diff --git a/app/workers/repository_import_worker.rb b/app/workers/repository_import_worker.rb index b546f8777e1..94832872d13 100644 --- a/app/workers/repository_import_worker.rb +++ b/app/workers/repository_import_worker.rb @@ -27,6 +27,7 @@ class RepositoryImportWorker project.import_finish project.save + project.satellite.create unless project.satellite.exists? ProjectCacheWorker.perform_async(project.id) Gitlab::BitbucketImport::KeyDeleter.new(project).execute if project.import_type == 'bitbucket' end |