Commit 09cf7b3f authored by Paul Okstad's avatar Paul Okstad Committed by Robert Speicher

Upgrade Gitaly gem and fix UserSquash RPC usage

Gitaly v1.84.0 removes the branch parameter from the UserSquash RPC in
https://gitlab.com/gitlab-org/gitaly/merge_requests/1786 because the
target branch isn't actually relevant to squash. Only the start and end
SHA matter here because squash is concerned primarily about collapsing
commits from the source, not target, branch.
parent fadb4349
......@@ -456,7 +456,7 @@ group :ed25519 do
end
# Gitaly GRPC protocol definitions
gem 'gitaly', '~> 1.86.0'
gem 'gitaly', '~> 12.9.0.pre.rc4'
gem 'grpc', '~> 1.24.0'
......
......@@ -366,7 +366,7 @@ GEM
po_to_json (>= 1.0.0)
rails (>= 3.2.0)
git (1.5.0)
gitaly (1.86.0)
gitaly (12.9.0.pre.rc4)
grpc (~> 1.0)
github-markup (1.7.0)
gitlab-chronic (0.10.5)
......@@ -1228,7 +1228,7 @@ DEPENDENCIES
gettext (~> 3.2.2)
gettext_i18n_rails (~> 1.8.0)
gettext_i18n_rails_js (~> 1.3)
gitaly (~> 1.86.0)
gitaly (~> 12.9.0.pre.rc4)
github-markup (~> 1.7.0)
gitlab-chronic (~> 0.10.5)
gitlab-derailed_benchmarks
......
......@@ -1061,8 +1061,7 @@ class Repository
end
def squash(user, merge_request, message)
raw.squash(user, merge_request.id, branch: merge_request.target_branch,
start_sha: merge_request.diff_start_sha,
raw.squash(user, merge_request.id, start_sha: merge_request.diff_start_sha,
end_sha: merge_request.diff_head_sha,
author: merge_request.author,
message: message)
......
---
title: Upgrade Gitaly gem and fix UserSquash RPC usage
merge_request: 27372
author:
type: other
......@@ -842,10 +842,9 @@ module Gitlab
end
end
def squash(user, squash_id, branch:, start_sha:, end_sha:, author:, message:)
def squash(user, squash_id, start_sha:, end_sha:, author:, message:)
wrapped_gitaly_errors do
gitaly_operation_client.user_squash(user, squash_id, branch,
start_sha, end_sha, author, message)
gitaly_operation_client.user_squash(user, squash_id, start_sha, end_sha, author, message)
end
end
......
......@@ -248,12 +248,11 @@ module Gitlab
request_enum.close
end
def user_squash(user, squash_id, branch, start_sha, end_sha, author, message)
def user_squash(user, squash_id, start_sha, end_sha, author, message)
request = Gitaly::UserSquashRequest.new(
repository: @gitaly_repo,
user: Gitlab::Git::User.from_gitlab(user).to_gitaly,
squash_id: squash_id.to_s,
branch: encode_binary(branch),
start_sha: start_sha,
end_sha: end_sha,
author: Gitlab::Git::User.from_gitlab(author).to_gitaly,
......
......@@ -274,7 +274,6 @@ describe Gitlab::GitalyClient::OperationService do
end
describe '#user_squash' do
let(:branch_name) { 'my-branch' }
let(:squash_id) { '1' }
let(:start_sha) { 'b83d6e391c22777fca1ed3012fce84f633d7fed0' }
let(:end_sha) { '54cec5282aa9f21856362fe321c800c236a61615' }
......@@ -284,7 +283,6 @@ describe Gitlab::GitalyClient::OperationService do
repository: repository.gitaly_repository,
user: gitaly_user,
squash_id: squash_id.to_s,
branch: branch_name,
start_sha: start_sha,
end_sha: end_sha,
author: gitaly_user,
......@@ -295,7 +293,7 @@ describe Gitlab::GitalyClient::OperationService do
let(:response) { Gitaly::UserSquashResponse.new(squash_sha: squash_sha) }
subject do
client.user_squash(user, squash_id, branch_name, start_sha, end_sha, user, commit_message)
client.user_squash(user, squash_id, start_sha, end_sha, user, commit_message)
end
it 'sends a user_squash message and returns the squash sha' do
......
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