Commit 6791eefe authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent 8e39b3a3
......@@ -222,6 +222,11 @@ Check the directory layout on your Gitaly server to be sure.
[auth]
token = 'abc123secret'
[logging]
format = 'json'
level = 'info'
dir = '/var/log/gitaly'
```
1. Append the following to `/home/git/gitaly/config.toml` for each respective server:
......
......@@ -155,10 +155,6 @@ module Gitlab
end
end
def extract_signature(repository, commit_id)
repository.gitaly_commit_client.extract_signature(commit_id)
end
def extract_signature_lazily(repository, commit_id)
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|
......
......@@ -348,25 +348,6 @@ module Gitlab
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)
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)
......
......@@ -75,10 +75,10 @@ gitlab:
workhorse:
resources:
requests:
cpu: 175m
cpu: 300m
memory: 100M
limits:
cpu: 350m
cpu: 600m
memory: 200M
readinessProbe:
initialDelaySeconds: 5 # Default is 0
......
......@@ -428,7 +428,9 @@ describe Gitlab::Git::Commit, :seed_helper do
end
end
shared_examples 'extracting commit signature' do
describe '.extract_signature_lazily' do
subject { described_class.extract_signature_lazily(repository, commit_id).itself }
context 'when the commit is signed' do
let(:commit_id) { '0b4bc9a49b562e85de7cc9e834518ea6828729b9' }
......@@ -492,10 +494,8 @@ describe Gitlab::Git::Commit, :seed_helper do
expect { subject }.to raise_error(ArgumentError)
end
end
end
describe '.extract_signature_lazily' do
describe 'loading signatures in batch once' do
context 'when loading signatures in batch once' do
it 'fetches signatures in batch once' do
commit_ids = %w[0b4bc9a49b562e85de7cc9e834518ea6828729b9 4b4918a572fa86f9771e5ba40fbd48e1eb03e2c6]
signatures = commit_ids.map do |commit_id|
......@@ -516,16 +516,6 @@ describe Gitlab::Git::Commit, :seed_helper do
2.times { signatures.each(&:itself) }
end
end
subject { described_class.extract_signature_lazily(repository, commit_id).itself }
it_behaves_like 'extracting commit signature'
end
describe '.extract_signature' do
subject { described_class.extract_signature(repository, commit_id) }
it_behaves_like 'extracting commit signature'
end
end
......
# frozen_string_literal: true
require 'spec_helper'
describe AbuseReportMailer do
......
# frozen_string_literal: true
require 'spec_helper'
require 'email_spec'
......
# frozen_string_literal: true
require 'spec_helper'
require 'email_spec'
......
# frozen_string_literal: true
require 'spec_helper'
require 'email_spec'
......
# frozen_string_literal: true
require 'spec_helper'
require 'email_spec'
......
# frozen_string_literal: true
require 'spec_helper'
describe RepositoryCheckMailer 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