From fb6a4e21d4a5142e72ac5864fae29192cfc59d64 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Thu, 21 Feb 2019 13:07:26 -0800 Subject: Bring back Rugged implementation of find_commit This brings back some of the changes in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20339. For users using Gitaly on top of NFS, accessing the Git data directly via Rugged is more performant than Gitaly. This merge request introduces the feature flag `rugged_find_commit` to activate Rugged paths. There are also Rake tasks `gitlab:features:enable_rugged` and `gitlab:features:disable_rugged` to enable/disable these feature flags altogether. Part of four Rugged changes identified in https://gitlab.com/gitlab-org/gitlab-ce/issues/57317. --- scripts/lint-rugged | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts/lint-rugged') diff --git a/scripts/lint-rugged b/scripts/lint-rugged index 22e3e1f1505..9466c62a415 100755 --- a/scripts/lint-rugged +++ b/scripts/lint-rugged @@ -5,12 +5,18 @@ ALLOWED = [ 'lib/gitlab/bare_repository_import/repository.rb', # Needed to avoid using the git binary to validate a branch name - 'lib/gitlab/git_ref_validator.rb' + 'lib/gitlab/git_ref_validator.rb', + + # Reverted Rugged calls due to Gitaly atop NFS performance + # See https://docs.gitlab.com/ee/development/gitaly.html#legacy-rugged-code. + 'lib/gitlab/git/rugged_impl/', + 'lib/gitlab/gitaly_client/storage_settings.rb' ].freeze rugged_lines = IO.popen(%w[git grep -i -n rugged -- app config lib], &:read).lines rugged_lines = rugged_lines.select { |l| /^[^:]*\.rb:/ =~ l } rugged_lines = rugged_lines.reject { |l| l.start_with?(*ALLOWED) } +rugged_lines = rugged_lines.reject { |l| /(include|prepend) Gitlab::Git::RuggedImpl/ =~ l} rugged_lines = rugged_lines.reject do |line| code, _comment = line.split('# ', 2) code !~ /rugged/i -- cgit v1.2.1