Commit 8a6f58ae authored by Mario Celi's avatar Mario Celi

Remove not_issuable_queries feature flag

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