Commit 995ed49e authored by Fabio Pitino's avatar Fabio Pitino Committed by Stan Hu

Allow skip_ci to be passed to rebase

Send `skip_ci` flag to Gitaly Rebase RPC and use it as
push options in the PostReceive hook to skip CI.
parent cf4e99d0
...@@ -1062,7 +1062,7 @@ class Repository ...@@ -1062,7 +1062,7 @@ class Repository
rebase_sha rebase_sha
end end
def rebase(user, merge_request) def rebase(user, merge_request, skip_ci: false)
if Feature.disabled?(:two_step_rebase, default_enabled: true) if Feature.disabled?(:two_step_rebase, default_enabled: true)
return rebase_deprecated(user, merge_request) return rebase_deprecated(user, merge_request)
end end
...@@ -1073,7 +1073,8 @@ class Repository ...@@ -1073,7 +1073,8 @@ class Repository
branch: merge_request.source_branch, branch: merge_request.source_branch,
branch_sha: merge_request.source_branch_sha, branch_sha: merge_request.source_branch_sha,
remote_repository: merge_request.target_project.repository.raw, remote_repository: merge_request.target_project.repository.raw,
remote_branch: merge_request.target_branch remote_branch: merge_request.target_branch,
skip_ci: skip_ci
) do |commit_id| ) do |commit_id|
merge_request.update!(rebase_commit_sha: commit_id, merge_error: nil) merge_request.update!(rebase_commit_sha: commit_id, merge_error: nil)
end end
......
...@@ -853,7 +853,7 @@ module Gitlab ...@@ -853,7 +853,7 @@ module Gitlab
end end
end end
def rebase(user, rebase_id, branch:, branch_sha:, remote_repository:, remote_branch:, &block) def rebase(user, rebase_id, branch:, branch_sha:, remote_repository:, remote_branch:, skip_ci: false, &block)
wrapped_gitaly_errors do wrapped_gitaly_errors do
gitaly_operation_client.rebase( gitaly_operation_client.rebase(
user, user,
...@@ -862,6 +862,7 @@ module Gitlab ...@@ -862,6 +862,7 @@ module Gitlab
branch_sha: branch_sha, branch_sha: branch_sha,
remote_repository: remote_repository, remote_repository: remote_repository,
remote_branch: remote_branch, remote_branch: remote_branch,
skip_ci: skip_ci,
&block &block
) )
end end
......
...@@ -233,7 +233,7 @@ module Gitlab ...@@ -233,7 +233,7 @@ module Gitlab
end end
end end
def rebase(user, rebase_id, branch:, branch_sha:, remote_repository:, remote_branch:) def rebase(user, rebase_id, branch:, branch_sha:, remote_repository:, remote_branch:, skip_ci: false)
request_enum = QueueEnumerator.new request_enum = QueueEnumerator.new
rebase_sha = nil rebase_sha = nil
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment