Commit fc5b0587 authored by Patrick Steinhardt's avatar Patrick Steinhardt

gitaly_client: Drop use of squash ID

In the past, the `UserSquash` RPC used to create worktrees in order to
compute the squashed commit. Starting with Gitaly v14.2.0, the RPC was
converted to never create worktrees anymore but instead to always
compute the commit in-memory. The squash ID, which used to indicate to
Gitaly how the worktree should be named and was required such that
`IsSquashInProgress()` knew which worktree to target, is thus not used
at all anymore and callers of `IsSquashInProgress()` have since been
removed.

Drop support for the deprecated squash ID such that it can eventually be
removed from Gitaly's protobuf definitions.
parent b98b20f8
......@@ -1054,10 +1054,10 @@ class Repository
end
def squash(user, merge_request, message)
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)
raw.squash(user, start_sha: merge_request.diff_start_sha,
end_sha: merge_request.diff_head_sha,
author: merge_request.author,
message: message)
end
def submodule_links
......
......@@ -870,9 +870,9 @@ module Gitlab
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
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
......
......@@ -259,11 +259,10 @@ module Gitlab
request_enum.close
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(
repository: @gitaly_repo,
user: Gitlab::Git::User.from_gitlab(user).to_gitaly,
squash_id: squash_id.to_s,
start_sha: start_sha,
end_sha: end_sha,
author: Gitlab::Git::User.from_gitlab(author).to_gitaly,
......
......@@ -2238,7 +2238,6 @@ RSpec.describe Gitlab::Git::Repository, :seed_helper do
end
describe '#squash' do
let(:squash_id) { '1' }
let(:branch_name) { 'fix' }
let(:start_sha) { '4b4918a572fa86f9771e5ba40fbd48e1eb03e2c6' }
let(:end_sha) { '12d65c8dd2b2676fa3ac47d955accc085a37a9c1' }
......@@ -2252,7 +2251,7 @@ RSpec.describe Gitlab::Git::Repository, :seed_helper do
message: 'Squash commit message'
}
repository.squash(user, squash_id, opts)
repository.squash(user, opts)
end
# 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
end
describe '#user_squash' do
let(:squash_id) { '1' }
let(:start_sha) { 'b83d6e391c22777fca1ed3012fce84f633d7fed0' }
let(:end_sha) { '54cec5282aa9f21856362fe321c800c236a61615' }
let(:commit_message) { 'Squash message' }
......@@ -321,7 +320,6 @@ RSpec.describe Gitlab::GitalyClient::OperationService do
Gitaly::UserSquashRequest.new(
repository: repository.gitaly_repository,
user: gitaly_user,
squash_id: squash_id.to_s,
start_sha: start_sha,
end_sha: end_sha,
author: gitaly_user,
......@@ -334,7 +332,7 @@ RSpec.describe Gitlab::GitalyClient::OperationService do
let(:response) { Gitaly::UserSquashResponse.new(squash_sha: squash_sha) }
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
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