diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /app/finders/issuable_finder.rb | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
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 |