Commit 36d75be3 authored by Zeger-Jan van de Weg's avatar Zeger-Jan van de Weg

Move TagNames to mandatory through Gitaly

Closes: https://gitlab.com/gitlab-org/gitaly/issues/220
parent 89095530
...@@ -150,12 +150,8 @@ module Gitlab ...@@ -150,12 +150,8 @@ module Gitlab
# Returns an Array of branch names # Returns an Array of branch names
# sorted by name ASC # sorted by name ASC
def branch_names def branch_names
gitaly_migrate(:branch_names, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled| wrapped_gitaly_errors do
if is_enabled
gitaly_ref_client.branch_names gitaly_ref_client.branch_names
else
branches.map(&:name)
end
end end
end end
...@@ -268,8 +264,10 @@ module Gitlab ...@@ -268,8 +264,10 @@ module Gitlab
# Returns an Array of tag names # Returns an Array of tag names
def tag_names def tag_names
wrapped_gitaly_errors do
gitaly_ref_client.tag_names gitaly_ref_client.tag_names
end end
end
# Returns an Array of Tags # Returns an Array of Tags
# #
...@@ -1420,6 +1418,16 @@ module Gitlab ...@@ -1420,6 +1418,16 @@ module Gitlab
raise CommandError.new(e) raise CommandError.new(e)
end end
def wrapped_gitaly_errors(&block)
yield block
rescue GRPC::NotFound => e
raise NoRepository.new(e)
rescue GRPC::InvalidArgument => e
raise ArgumentError.new(e)
rescue GRPC::BadStatus => e
raise CommandError.new(e)
end
def clean_stale_repository_files def clean_stale_repository_files
gitaly_migrate(:repository_cleanup, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled| gitaly_migrate(:repository_cleanup, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled|
gitaly_repository_client.cleanup if is_enabled && exists? gitaly_repository_client.cleanup if is_enabled && exists?
......
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