diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-06-28 10:45:31 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-06-28 10:45:31 +0300 |
commit | e38db19659857f949eca4c844cfc1af1c69d8fab (patch) | |
tree | ca466363d82a7a12e2831dfec3416909a8bbd97c /lib/gitlab/git/commit.rb | |
parent | c9de5be58e8c688e6ec6381ee990837b75946a9e (diff) | |
parent | f4d68347866a9f2def248864be40f2249713b351 (diff) |
Merge branch 'gitaly-mandatory-20180627-jv-2' into 'master'
Make Gitaly signature RPC's mandatory
Closes gitaly#745, gitaly#1044, and gitaly#876
See merge request gitlab-org/gitlab-ce!20212
Diffstat (limited to 'lib/gitlab/git/commit.rb')
-rw-r--r-- | lib/gitlab/git/commit.rb | 49 |
1 files changed, 2 insertions, 47 deletions
diff --git a/lib/gitlab/git/commit.rb b/lib/gitlab/git/commit.rb index a6c3f446656..01274505557 100644 --- a/lib/gitlab/git/commit.rb +++ b/lib/gitlab/git/commit.rb @@ -220,19 +220,7 @@ module Gitlab end def shas_with_signatures(repository, shas) - GitalyClient.migrate(:filter_shas_with_signatures) do |is_enabled| - if is_enabled - Gitlab::GitalyClient::CommitService.new(repository).filter_shas_with_signatures(shas) - else - shas.select do |sha| - begin - Rugged::Commit.extract_signature(repository.rugged, sha) - rescue Rugged::OdbError - false - end - end - end - end + Gitlab::GitalyClient::CommitService.new(repository).filter_shas_with_signatures(shas) end # Only to be used when the object ids will not necessarily have a @@ -250,13 +238,7 @@ module Gitlab end def extract_signature(repository, commit_id) - repository.gitaly_migrate(:extract_commit_signature) do |is_enabled| - if is_enabled - repository.gitaly_commit_client.extract_signature(commit_id) - else - rugged_extract_signature(repository, commit_id) - end - end + repository.gitaly_commit_client.extract_signature(commit_id) end def extract_signature_lazily(repository, commit_id) @@ -276,36 +258,9 @@ module Gitlab end def batch_signature_extraction(repository, commit_ids) - repository.gitaly_migrate(:extract_commit_signature_in_batch) do |is_enabled| - if is_enabled - gitaly_batch_signature_extraction(repository, commit_ids) - else - rugged_batch_signature_extraction(repository, commit_ids) - end - end - end - - def gitaly_batch_signature_extraction(repository, commit_ids) repository.gitaly_commit_client.get_commit_signatures(commit_ids) end - def rugged_batch_signature_extraction(repository, commit_ids) - commit_ids.each_with_object({}) do |commit_id, signatures| - signature_data = rugged_extract_signature(repository, commit_id) - next unless signature_data - - signatures[commit_id] = signature_data - end - end - - def rugged_extract_signature(repository, commit_id) - begin - Rugged::Commit.extract_signature(repository.rugged, commit_id) - rescue Rugged::OdbError - nil - end - end - def get_message(repository, commit_id) BatchLoader.for({ repository: repository, commit_id: commit_id }).batch do |items, loader| items_by_repo = items.group_by { |i| i[:repository] } |