diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2017-12-20 10:01:21 +0100 |
---|---|---|
committer | Jan Provaznik <jprovaznik@gitlab.com> | 2018-01-05 09:34:59 +0100 |
commit | 27a75ea1757d1c1b67bf501ec333221ed5e92d04 (patch) | |
tree | 4ef9caa88a19ed27cc58d60e42769a2fe5cf1e8d /app/workers | |
parent | 1560c234d2410ccbd163b9aedecf2d8b7a596627 (diff) | |
download | gitlab-ce-27a75ea1757d1c1b67bf501ec333221ed5e92d04.tar.gz |
Backport 'Rebase' feature from EE to CEjprovazn-rebase
When a project uses fast-forward merging strategy user has
to rebase MRs to target branch before it can be merged.
Now user can do rebase in UI by clicking 'Rebase' button
instead of doing rebase locally.
This feature was already present in EE, this is only backport
of the feature to CE. Couple of changes:
* removed rebase license check
* renamed migration (changed timestamp)
Closes #40301
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/all_queues.yml | 1 | ||||
-rw-r--r-- | app/workers/rebase_worker.rb | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index 268b7028fd9..fafd9e5ef00 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -89,6 +89,7 @@ - project_service - propagate_service_template - reactive_caching +- rebase - repository_fork - repository_import - storage_migrator diff --git a/app/workers/rebase_worker.rb b/app/workers/rebase_worker.rb new file mode 100644 index 00000000000..090987778a2 --- /dev/null +++ b/app/workers/rebase_worker.rb @@ -0,0 +1,12 @@ +class RebaseWorker + include ApplicationWorker + + def perform(merge_request_id, current_user_id) + current_user = User.find(current_user_id) + merge_request = MergeRequest.find(merge_request_id) + + MergeRequests::RebaseService + .new(merge_request.source_project, current_user) + .execute(merge_request) + end +end |