Commit 47741628 authored by Zeger-Jan van de Weg's avatar Zeger-Jan van de Weg
Browse files

Set Gitlab::Shell#create_repository as OPT_OUT

On .com repositories are created through Gitaly for a while now. For
customers this is not the case unless these have chosen to do so through
feature flags. By moving this to opt out, everyone will be using this.

This move is part of the migration issue

The bigger impact this commit will have is that tests that use a
repository through `FactoryBot.create(:project, :repository)` will now
use Gitaly to do so. As tests run on the same disk, or at least machine,
this will most probably slow them down.
parent 7e836c5e0f54
......@@ -75,7 +75,8 @@
relative_path = name.dup
relative_path << '.git' unless relative_path.end_with?('.git')
gitaly_migrate(:create_repository) do |is_enabled|
status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled|
if is_enabled
repository =, relative_path, '')
......@@ -85,7 +86,7 @@
Gitlab::Git::Repository.create(repo_path, bare: true, symlink_hooks_to: gitlab_shell_hooks_path)
rescue => err
rescue => err # Once the Rugged codes gets removes this can be improved
Rails.logger.error("Failed to add repository #{storage}/#{name}: #{err}")
......@@ -487,8 +488,8 @@
def gitaly_migrate(method, &block)
Gitlab::GitalyClient.migrate(method, &block)
def gitaly_migrate(method, status: Gitlab::GitalyClient::MigrationStatus::OPT_IN, &block)
Gitlab::GitalyClient.migrate(method, status: status, &block)
rescue GRPC::NotFound, GRPC::BadStatus => e
# Old Popen code returns [Error, output] to the caller, so we
# need to do the same here...
Supports Markdown
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