summaryrefslogtreecommitdiff
path: root/app/services/merge_requests
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2019-06-21 17:56:47 +0100
committerNick Thomas <nick@gitlab.com>2019-07-04 08:50:55 +0100
commit381468d0cc6e5b528a4b2207c0a534569035a73f (patch)
tree2ffc9e9062fef50a7cca8dfd8d0b5733e8cf4c9d /app/services/merge_requests
parent9ef0c8559de925d0a72a3fe421d95209c2b81d8f (diff)
downloadgitlab-ce-381468d0cc6e5b528a4b2207c0a534569035a73f.tar.gz
Allow asynchronous rebase operations to be monitored
This MR introduces tracking of the `rebase_jid` for merge requests. As with `merge_ongoing?`, `rebase_in_progress?` will now return true if a rebase is proceeding in sidekiq. After one release, we should remove the Gitaly-based lookup of rebases. It is much better to track this kind of thing via the database.
Diffstat (limited to 'app/services/merge_requests')
-rw-r--r--app/services/merge_requests/rebase_service.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/services/merge_requests/rebase_service.rb b/app/services/merge_requests/rebase_service.rb
index 4b9921c28ba..8d3b9b05819 100644
--- a/app/services/merge_requests/rebase_service.rb
+++ b/app/services/merge_requests/rebase_service.rb
@@ -15,7 +15,7 @@ module MergeRequests
end
def rebase
- if merge_request.rebase_in_progress?
+ if merge_request.gitaly_rebase_in_progress?
log_error('Rebase task canceled: Another rebase is already in progress', save_message_on_model: true)
return false
end
@@ -27,6 +27,8 @@ module MergeRequests
log_error(REBASE_ERROR, save_message_on_model: true)
log_error(e.message)
false
+ ensure
+ merge_request.update_column(:rebase_jid, nil)
end
end
end