diff options
Diffstat (limited to 'app/finders/issuable_finder.rb')
-rw-r--r-- | app/finders/issuable_finder.rb | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb index f13dc8c2451..9c4aecedd93 100644 --- a/app/finders/issuable_finder.rb +++ b/app/finders/issuable_finder.rb @@ -102,7 +102,7 @@ class IssuableFinder items = filter_items(items) # Let's see if we have to negate anything - items = filter_negated_items(items) + items = filter_negated_items(items) if should_filter_negated_args? # This has to be last as we use a CTE as an optimization fence # for counts by passing the force_cte param and passing the @@ -134,13 +134,15 @@ class IssuableFinder by_my_reaction_emoji(items) end - # Negates all params found in `negatable_params` - def filter_negated_items(items) - return items unless Feature.enabled?(:not_issuable_queries, params.group || params.project, default_enabled: true) + def should_filter_negated_args? + return false unless Feature.enabled?(:not_issuable_queries, params.group || params.project, default_enabled: true) # API endpoints send in `nil` values so we test if there are any non-nil - return items unless not_params.present? && not_params.values.any? + not_params.present? && not_params.values.any? + end + # Negates all params found in `negatable_params` + def filter_negated_items(items) items = by_negated_author(items) items = by_negated_assignee(items) items = by_negated_label(items) @@ -151,7 +153,11 @@ class IssuableFinder end def row_count - Gitlab::IssuablesCountForState.new(self).for_state_or_opened(params[:state]) + fast_fail = Feature.enabled?(:soft_fail_count_by_state, params.group || params.project) + + Gitlab::IssuablesCountForState + .new(self, nil, fast_fail: fast_fail) + .for_state_or_opened(params[:state]) end # We often get counts for each state by running a query per state, and |