Commit 18111713 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'pokstad1-remove-branch-user-squash' into 'master'

Upgrade Gitaly gem and fix UserSquash RPC usage

See merge request gitlab-org/gitlab!27372
parents 25fddbf4 09cf7b3f
...@@ -456,7 +456,7 @@ group :ed25519 do ...@@ -456,7 +456,7 @@ group :ed25519 do
end end
# Gitaly GRPC protocol definitions # Gitaly GRPC protocol definitions
gem 'gitaly', '~> 1.86.0' gem 'gitaly', '~> 12.9.0.pre.rc4'
gem 'grpc', '~> 1.24.0' gem 'grpc', '~> 1.24.0'
......
...@@ -366,7 +366,7 @@ GEM ...@@ -366,7 +366,7 @@ GEM
po_to_json (>= 1.0.0) po_to_json (>= 1.0.0)
rails (>= 3.2.0) rails (>= 3.2.0)
git (1.5.0) git (1.5.0)
gitaly (1.86.0) gitaly (12.9.0.pre.rc4)
grpc (~> 1.0) grpc (~> 1.0)
github-markup (1.7.0) github-markup (1.7.0)
gitlab-chronic (0.10.5) gitlab-chronic (0.10.5)
...@@ -1228,7 +1228,7 @@ DEPENDENCIES ...@@ -1228,7 +1228,7 @@ DEPENDENCIES
gettext (~> 3.2.2) gettext (~> 3.2.2)
gettext_i18n_rails (~> 1.8.0) gettext_i18n_rails (~> 1.8.0)
gettext_i18n_rails_js (~> 1.3) gettext_i18n_rails_js (~> 1.3)
gitaly (~> 1.86.0) gitaly (~> 12.9.0.pre.rc4)
github-markup (~> 1.7.0) github-markup (~> 1.7.0)
gitlab-chronic (~> 0.10.5) gitlab-chronic (~> 0.10.5)
gitlab-derailed_benchmarks gitlab-derailed_benchmarks
......
...@@ -1061,8 +1061,7 @@ class Repository ...@@ -1061,8 +1061,7 @@ class Repository
end end
def squash(user, merge_request, message) def squash(user, merge_request, message)
raw.squash(user, merge_request.id, branch: merge_request.target_branch, raw.squash(user, merge_request.id, start_sha: merge_request.diff_start_sha,
start_sha: merge_request.diff_start_sha,
end_sha: merge_request.diff_head_sha, end_sha: merge_request.diff_head_sha,
author: merge_request.author, author: merge_request.author,
message: message) message: message)
......
---
title: Upgrade Gitaly gem and fix UserSquash RPC usage
merge_request: 27372
author:
type: other
...@@ -842,10 +842,9 @@ module Gitlab ...@@ -842,10 +842,9 @@ module Gitlab
end end
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 wrapped_gitaly_errors do
gitaly_operation_client.user_squash(user, squash_id, branch, gitaly_operation_client.user_squash(user, squash_id, start_sha, end_sha, author, message)
start_sha, end_sha, author, message)
end end
end end
......
...@@ -248,12 +248,11 @@ module Gitlab ...@@ -248,12 +248,11 @@ module Gitlab
request_enum.close request_enum.close
end 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( request = Gitaly::UserSquashRequest.new(
repository: @gitaly_repo, repository: @gitaly_repo,
user: Gitlab::Git::User.from_gitlab(user).to_gitaly, user: Gitlab::Git::User.from_gitlab(user).to_gitaly,
squash_id: squash_id.to_s, squash_id: squash_id.to_s,
branch: encode_binary(branch),
start_sha: start_sha, start_sha: start_sha,
end_sha: end_sha, end_sha: end_sha,
author: Gitlab::Git::User.from_gitlab(author).to_gitaly, author: Gitlab::Git::User.from_gitlab(author).to_gitaly,
......
...@@ -274,7 +274,6 @@ describe Gitlab::GitalyClient::OperationService do ...@@ -274,7 +274,6 @@ describe Gitlab::GitalyClient::OperationService do
end end
describe '#user_squash' do describe '#user_squash' do
let(:branch_name) { 'my-branch' }
let(:squash_id) { '1' } let(:squash_id) { '1' }
let(:start_sha) { 'b83d6e391c22777fca1ed3012fce84f633d7fed0' } let(:start_sha) { 'b83d6e391c22777fca1ed3012fce84f633d7fed0' }
let(:end_sha) { '54cec5282aa9f21856362fe321c800c236a61615' } let(:end_sha) { '54cec5282aa9f21856362fe321c800c236a61615' }
...@@ -284,7 +283,6 @@ describe Gitlab::GitalyClient::OperationService do ...@@ -284,7 +283,6 @@ describe Gitlab::GitalyClient::OperationService do
repository: repository.gitaly_repository, repository: repository.gitaly_repository,
user: gitaly_user, user: gitaly_user,
squash_id: squash_id.to_s, squash_id: squash_id.to_s,
branch: branch_name,
start_sha: start_sha, start_sha: start_sha,
end_sha: end_sha, end_sha: end_sha,
author: gitaly_user, author: gitaly_user,
...@@ -295,7 +293,7 @@ describe Gitlab::GitalyClient::OperationService do ...@@ -295,7 +293,7 @@ describe Gitlab::GitalyClient::OperationService do
let(:response) { Gitaly::UserSquashResponse.new(squash_sha: squash_sha) } let(:response) { Gitaly::UserSquashResponse.new(squash_sha: squash_sha) }
subject do 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 end
it 'sends a user_squash message and returns the squash sha' do 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