Commit 1370dc78 authored by Max Woolf's avatar Max Woolf

Merge branch 'pks-drop-squash-id' into 'master'

gitaly_client: Drop use of squash ID

See merge request gitlab-org/gitlab!70773
parents b2a333b7 fc5b0587
...@@ -1054,7 +1054,7 @@ class Repository ...@@ -1054,7 +1054,7 @@ class Repository
end end
def squash(user, merge_request, message) def squash(user, merge_request, message)
raw.squash(user, merge_request.id, start_sha: merge_request.diff_start_sha, raw.squash(user, 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)
......
...@@ -870,9 +870,9 @@ module Gitlab ...@@ -870,9 +870,9 @@ module Gitlab
end end
end end
def squash(user, squash_id, start_sha:, end_sha:, author:, message:) def squash(user, start_sha:, end_sha:, author:, message:)
wrapped_gitaly_errors do wrapped_gitaly_errors do
gitaly_operation_client.user_squash(user, squash_id, start_sha, end_sha, author, message) gitaly_operation_client.user_squash(user, start_sha, end_sha, author, message)
end end
end end
......
...@@ -259,11 +259,10 @@ module Gitlab ...@@ -259,11 +259,10 @@ module Gitlab
request_enum.close request_enum.close
end end
def user_squash(user, squash_id, start_sha, end_sha, author, message, time = Time.now.utc) def user_squash(user, start_sha, end_sha, author, message, time = Time.now.utc)
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,
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,
......
...@@ -2238,7 +2238,6 @@ RSpec.describe Gitlab::Git::Repository, :seed_helper do ...@@ -2238,7 +2238,6 @@ RSpec.describe Gitlab::Git::Repository, :seed_helper do
end end
describe '#squash' do describe '#squash' do
let(:squash_id) { '1' }
let(:branch_name) { 'fix' } let(:branch_name) { 'fix' }
let(:start_sha) { '4b4918a572fa86f9771e5ba40fbd48e1eb03e2c6' } let(:start_sha) { '4b4918a572fa86f9771e5ba40fbd48e1eb03e2c6' }
let(:end_sha) { '12d65c8dd2b2676fa3ac47d955accc085a37a9c1' } let(:end_sha) { '12d65c8dd2b2676fa3ac47d955accc085a37a9c1' }
...@@ -2252,7 +2251,7 @@ RSpec.describe Gitlab::Git::Repository, :seed_helper do ...@@ -2252,7 +2251,7 @@ RSpec.describe Gitlab::Git::Repository, :seed_helper do
message: 'Squash commit message' message: 'Squash commit message'
} }
repository.squash(user, squash_id, opts) repository.squash(user, opts)
end end
# Should be ported to gitaly-ruby rspec suite https://gitlab.com/gitlab-org/gitaly/issues/1234 # Should be ported to gitaly-ruby rspec suite https://gitlab.com/gitlab-org/gitaly/issues/1234
......
...@@ -308,7 +308,6 @@ RSpec.describe Gitlab::GitalyClient::OperationService do ...@@ -308,7 +308,6 @@ RSpec.describe Gitlab::GitalyClient::OperationService do
end end
describe '#user_squash' do describe '#user_squash' do
let(:squash_id) { '1' }
let(:start_sha) { 'b83d6e391c22777fca1ed3012fce84f633d7fed0' } let(:start_sha) { 'b83d6e391c22777fca1ed3012fce84f633d7fed0' }
let(:end_sha) { '54cec5282aa9f21856362fe321c800c236a61615' } let(:end_sha) { '54cec5282aa9f21856362fe321c800c236a61615' }
let(:commit_message) { 'Squash message' } let(:commit_message) { 'Squash message' }
...@@ -321,7 +320,6 @@ RSpec.describe Gitlab::GitalyClient::OperationService do ...@@ -321,7 +320,6 @@ RSpec.describe Gitlab::GitalyClient::OperationService do
Gitaly::UserSquashRequest.new( Gitaly::UserSquashRequest.new(
repository: repository.gitaly_repository, repository: repository.gitaly_repository,
user: gitaly_user, user: gitaly_user,
squash_id: squash_id.to_s,
start_sha: start_sha, start_sha: start_sha,
end_sha: end_sha, end_sha: end_sha,
author: gitaly_user, author: gitaly_user,
...@@ -334,7 +332,7 @@ RSpec.describe Gitlab::GitalyClient::OperationService do ...@@ -334,7 +332,7 @@ RSpec.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, start_sha, end_sha, user, commit_message, time) client.user_squash(user, start_sha, end_sha, user, commit_message, time)
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