Commit 72f542fa authored by Zeger-Jan van de Weg's avatar Zeger-Jan van de Weg

Remove ExtractCommitSignature RPC

The RPC has gone unused as it didn't scale, and was replaced with
GetCommitSignatures. There's no active code path that calls this RPC and
Gitaly metrics confirms that it's gone unused.

Part of: https://gitlab.com/gitlab-org/gitlab/issues/31079
parent bb0bef9a
...@@ -155,10 +155,6 @@ module Gitlab ...@@ -155,10 +155,6 @@ module Gitlab
end end
end end
def extract_signature(repository, commit_id)
repository.gitaly_commit_client.extract_signature(commit_id)
end
def extract_signature_lazily(repository, commit_id) def extract_signature_lazily(repository, commit_id)
BatchLoader.for(commit_id).batch(key: repository) do |commit_ids, loader, args| BatchLoader.for(commit_id).batch(key: repository) do |commit_ids, loader, args|
batch_signature_extraction(args[:key], commit_ids).each do |commit_id, signature_data| batch_signature_extraction(args[:key], commit_ids).each do |commit_id, signature_data|
......
...@@ -348,25 +348,6 @@ module Gitlab ...@@ -348,25 +348,6 @@ module Gitlab
end end
end end
def extract_signature(commit_id)
request = Gitaly::ExtractCommitSignatureRequest.new(repository: @gitaly_repo, commit_id: commit_id)
response = GitalyClient.call(@repository.storage, :commit_service, :extract_commit_signature, request, timeout: GitalyClient.fast_timeout)
signature = +''.b
signed_text = +''.b
response.each do |message|
signature << message.signature
signed_text << message.signed_text
end
return if signature.blank? && signed_text.blank?
[signature, signed_text]
rescue GRPC::InvalidArgument => ex
raise ArgumentError, ex
end
def get_commit_signatures(commit_ids) def get_commit_signatures(commit_ids)
request = Gitaly::GetCommitSignaturesRequest.new(repository: @gitaly_repo, commit_ids: commit_ids) request = Gitaly::GetCommitSignaturesRequest.new(repository: @gitaly_repo, commit_ids: commit_ids)
response = GitalyClient.call(@repository.storage, :commit_service, :get_commit_signatures, request, timeout: GitalyClient.fast_timeout) response = GitalyClient.call(@repository.storage, :commit_service, :get_commit_signatures, request, timeout: GitalyClient.fast_timeout)
......
...@@ -521,12 +521,6 @@ describe Gitlab::Git::Commit, :seed_helper do ...@@ -521,12 +521,6 @@ describe Gitlab::Git::Commit, :seed_helper do
it_behaves_like 'extracting commit signature' it_behaves_like 'extracting commit signature'
end end
describe '.extract_signature' do
subject { described_class.extract_signature(repository, commit_id) }
it_behaves_like 'extracting commit signature'
end
end end
skip 'move this test to gitaly-ruby' do skip 'move this test to gitaly-ruby' 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