Commit f0009669 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch '292809-remove-not_issuable_queries-ff' into 'master'

Remove not_issuable_queries feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!60321
parents 03bc80ed 8a6f58ae
......@@ -50,7 +50,7 @@ export default class DropdownOperator extends FilteredSearchDropdown {
];
const dropdownToken = this.tokenKeys.searchByKey(dropdownName.toLowerCase());
if (gon.features?.notIssuableQueries && !dropdownToken?.hideNotEqual) {
if (!dropdownToken?.hideNotEqual) {
dropdownData.push({
tag: 'not-equal',
type: 'string',
......
......@@ -10,9 +10,6 @@ module BoardsActions
before_action :boards, only: :index
before_action :board, only: :show
before_action :push_licensed_features, only: [:index, :show]
before_action do
push_frontend_feature_flag(:not_issuable_queries, parent, default_enabled: true)
end
end
def index
......
......@@ -8,9 +8,6 @@ module IssuableActions
before_action :authorize_destroy_issuable!, only: :destroy
before_action :check_destroy_confirmation!, only: :destroy
before_action :authorize_admin_issuable!, only: :bulk_update
before_action do
push_frontend_feature_flag(:not_issuable_queries, @project, default_enabled: true)
end
end
def show
......
......@@ -32,10 +32,6 @@ module IssuableCollectionsAction
private
def set_not_query_feature_flag(object = nil)
push_frontend_feature_flag(:not_issuable_queries, object, default_enabled: true)
end
def sorting_field
case action_name
when 'issues'
......
......@@ -11,7 +11,6 @@ class DashboardController < Dashboard::ApplicationController
before_action :projects, only: [:issues, :merge_requests]
before_action :set_show_full_reference, only: [:issues, :merge_requests]
before_action :check_filters_presence!, only: [:issues, :merge_requests]
before_action :set_not_query_feature_flag
respond_to :html
......
......@@ -35,10 +35,6 @@ class GroupsController < Groups::ApplicationController
push_frontend_feature_flag(:vue_issuables_list, @group)
end
before_action do
set_not_query_feature_flag(@group)
end
before_action :export_rate_limit, only: [:export, :download_export]
helper_method :captcha_required?
......
......@@ -142,8 +142,6 @@ class IssuableFinder
end
def should_filter_negated_args?
return false unless not_filters_enabled?
# API endpoints send in `nil` values so we test if there are any non-nil
not_params.present? && not_params.values.any?
end
......@@ -370,8 +368,7 @@ class IssuableFinder
Issuables::AuthorFilter.new(
items,
params: original_params,
or_filters_enabled: or_filters_enabled?,
not_filters_enabled: not_filters_enabled?
or_filters_enabled: or_filters_enabled?
).filter
end
......@@ -496,12 +493,6 @@ class IssuableFinder
end
end
def not_filters_enabled?
strong_memoize(:not_filters_enabled) do
Feature.enabled?(:not_issuable_queries, feature_flag_scope, default_enabled: :yaml)
end
end
def feature_flag_scope
params.group || params.project
end
......
......@@ -27,7 +27,7 @@ module Issuables
end
def by_negated_author(issuables)
return issuables unless not_filters_enabled? && not_params.present?
return issuables unless not_params.present?
if not_params[:author_id].present?
issuables.not_authored(not_params[:author_id])
......
......@@ -4,11 +4,10 @@ module Issuables
class BaseFilter
attr_reader :issuables, :params
def initialize(issuables, params:, or_filters_enabled: false, not_filters_enabled: false)
def initialize(issuables, params:, or_filters_enabled: false)
@issuables = issuables
@params = params
@or_filters_enabled = or_filters_enabled
@not_filters_enabled = not_filters_enabled
end
def filter
......@@ -28,9 +27,5 @@ module Issuables
def or_filters_enabled?
@or_filters_enabled
end
def not_filters_enabled?
@not_filters_enabled
end
end
end
---
title: Remove not_issuable_queries feature flag
merge_request: 60321
author:
type: other
---
name: not_issuable_queries
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/27639
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/292809
milestone: '13.0'
type: development
group: group::project management
default_enabled: true
......@@ -6,9 +6,6 @@ module Projects
include ::Analytics::UniqueVisitsHelper
before_action :authorize_read_code_review_analytics!
before_action do
push_frontend_feature_flag(:not_issuable_queries, @project, default_enabled: true)
end
track_unique_visits :index, target_id: 'p_analytics_code_reviews'
......
......@@ -124,8 +124,6 @@ class EpicsFinder < IssuableFinder
end
def filter_negated_items(items)
return items unless not_filters_enabled?
# API endpoints send in `nil` values so we test if there are any non-nil
return items unless not_params&.values&.any?
......
......@@ -638,16 +638,6 @@ RSpec.describe EpicsFinder do
it 'returns all epics without negated label' do
expect(epics(params)).to contain_exactly(epic1, epic2, epic3)
end
context 'when not_issuable_queries is disabled' do
before do
stub_feature_flags(not_issuable_queries: false)
end
it 'returns epics that include negated params' do
expect(epics(params)).to contain_exactly(negated_epic, negated_epic2, epic1, epic2, epic3)
end
end
end
context 'with negated author' do
......@@ -662,16 +652,6 @@ RSpec.describe EpicsFinder do
it 'returns all epics without given author' do
expect(epics(params)).to contain_exactly(epic1, epic2, epic3)
end
context 'when not_issuable_queries is disabled' do
before do
stub_feature_flags(not_issuable_queries: false)
end
it 'returns epics that include negated params' do
expect(epics(params)).to contain_exactly(authored_epic, epic1, epic2, epic3)
end
end
end
context 'with negated reaction emoji' do
......@@ -681,16 +661,6 @@ RSpec.describe EpicsFinder do
it 'returns all epics without given emoji name' do
expect(epics(params)).to contain_exactly(epic1, epic2)
end
context 'when not_issuable_queries is disabled' do
before do
stub_feature_flags(not_issuable_queries: false)
end
it 'returns epics that include negated params' do
expect(epics(params)).to contain_exactly(epic1, epic2, epic3)
end
end
end
end
end
......
......@@ -119,46 +119,21 @@ RSpec.describe 'Project issue boards', :js do
end
context 'search list negation queries' do
context 'with the NOT queries feature flag disabled' do
before do
stub_feature_flags(not_issuable_queries: false)
visit_project_board_path_without_query_limit(project, board)
end
it 'does not have the != option' do
find('.filtered-search').set('label:')
wait_for_requests
within('#js-dropdown-operator') do
tokens = all(:css, 'li.filter-dropdown-item')
expect(tokens.count).to eq(1)
button = tokens[0].find('button')
expect(button).to have_content('=')
expect(button).not_to have_content('!=')
end
end
before do
visit_project_board_path_without_query_limit(project, board)
end
context 'with the NOT queries feature flag enabled' do
before do
stub_feature_flags(not_issuable_queries: true)
visit_project_board_path_without_query_limit(project, board)
end
it 'does not have the != option' do
find('.filtered-search').set('label:')
it 'does not have the != option' do
find('.filtered-search').set('label:')
wait_for_requests
within('#js-dropdown-operator') do
tokens = all(:css, 'li.filter-dropdown-item')
expect(tokens.count).to eq(2)
button = tokens[0].find('button')
expect(button).to have_content('=')
button = tokens[1].find('button')
expect(button).to have_content('!=')
end
wait_for_requests
within('#js-dropdown-operator') do
tokens = all(:css, 'li.filter-dropdown-item')
expect(tokens.count).to eq(2)
button = tokens[0].find('button')
expect(button).to have_content('=')
button = tokens[1].find('button')
expect(button).to have_content('!=')
end
end
end
......
......@@ -79,26 +79,6 @@ RSpec.describe 'Filter issues', :js do
expect_filtered_search_input(search_term)
end
context 'with the NOT queries feature flag disabled' do
before do
stub_feature_flags(not_issuable_queries: false)
visit project_issues_path(project)
end
it 'does not have the != option' do
input_filtered_search("label:", submit: false, extra_space: false)
wait_for_requests
within('#js-dropdown-operator') do
tokens = all(:css, 'li.filter-dropdown-item')
expect(tokens.count).to eq(1)
button = tokens[0].find('button')
expect(button).to have_content('=')
expect(button).not_to have_content('!=')
end
end
end
describe 'filter issues by author' do
context 'only author' do
it 'filters issues by searched author' do
......
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