Commit b2ef5746 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'n-plus-1-notice' into 'master'

Adds a Gitaly n+1 notice to commit handling on access check

See merge request gitlab-org/gitlab-ee!3034
parents 0586ea1c 725d921d
...@@ -162,6 +162,8 @@ module Gitlab ...@@ -162,6 +162,8 @@ module Gitlab
# if newrev is blank, the branch was deleted # if newrev is blank, the branch was deleted
return if deletion? || !(commit_validation || validate_path_locks?) return if deletion? || !(commit_validation || validate_path_locks?)
# n+1: https://gitlab.com/gitlab-org/gitlab-ee/issues/3593
Gitlab::GitalyClient.allow_n_plus_1_calls do
commits.each do |commit| commits.each do |commit|
if commit_validation if commit_validation
error = check_commit(commit, push_rule) error = check_commit(commit, push_rule)
...@@ -174,6 +176,7 @@ module Gitlab ...@@ -174,6 +176,7 @@ module Gitlab
end end
end end
end end
end
def branch_name_allowed_by_push_rule?(push_rule) def branch_name_allowed_by_push_rule?(push_rule)
return true unless push_rule return true unless push_rule
......
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