diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-10-05 08:04:12 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-10-05 08:04:12 +0000 |
commit | 3c8ccd2eda593205de8edde5102249372a1ed3a2 (patch) | |
tree | 47f05dea2c7137a9ab11710845fdfa85ec5cbff5 /lib/banzai | |
parent | 77d56c931af073ffb6583819bb216225456cb231 (diff) | |
parent | 7cb2755617a2f29498f4523b8915bc77abcae4df (diff) | |
download | gitlab-ce-3c8ccd2eda593205de8edde5102249372a1ed3a2.tar.gz |
Merge branch 'mao/48221-issues_show_sql_count' into 'master'
Banzai label ref finder - minimize SQL calls by sharing context more aggresively
Closes #48221
See merge request gitlab-org/gitlab-ce!22070
Diffstat (limited to 'lib/banzai')
-rw-r--r-- | lib/banzai/cross_project_reference.rb | 1 | ||||
-rw-r--r-- | lib/banzai/filter/label_reference_filter.rb | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/banzai/cross_project_reference.rb b/lib/banzai/cross_project_reference.rb index 3f1e95d4cc0..43f913a8859 100644 --- a/lib/banzai/cross_project_reference.rb +++ b/lib/banzai/cross_project_reference.rb @@ -13,6 +13,7 @@ module Banzai # Returns a Project, or nil if the reference can't be found def parent_from_ref(ref) return context[:project] || context[:group] unless ref + return context[:project] if context[:project]&.full_path == ref Project.find_by_full_path(ref) end diff --git a/lib/banzai/filter/label_reference_filter.rb b/lib/banzai/filter/label_reference_filter.rb index b92e9e55bb9..04ec38209c7 100644 --- a/lib/banzai/filter/label_reference_filter.rb +++ b/lib/banzai/filter/label_reference_filter.rb @@ -48,7 +48,7 @@ module Banzai include_ancestor_groups: true, only_group_labels: true } else - { project_id: parent.id, + { project: parent, include_ancestor_groups: true } end |