diff options
-rw-r--r-- | app/finders/issuable_finder.rb | 8 | ||||
-rw-r--r-- | app/models/broadcast_message.rb | 11 | ||||
-rw-r--r-- | app/models/label.rb | 1 | ||||
-rw-r--r-- | spec/features/issues_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/merge_requests/user_lists_merge_requests_spec.rb | 2 | ||||
-rw-r--r-- | spec/finders/issues_finder_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/broadcast_message_spec.rb | 8 | ||||
-rw-r--r-- | spec/requests/api/issues/issues_spec.rb | 20 | ||||
-rw-r--r-- | spec/support/shared_examples/finders/assignees_filter_shared_examples.rb | 6 |
9 files changed, 5 insertions, 61 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb index 50e9418677c..3592505a977 100644 --- a/app/finders/issuable_finder.rb +++ b/app/finders/issuable_finder.rb @@ -43,7 +43,7 @@ class IssuableFinder FILTER_NONE = 'none'.freeze FILTER_ANY = 'any'.freeze - # This is accepted as a deprecated filter and is also used in unassigning users + # This is used in unassigning users NONE = '0'.freeze attr_accessor :current_user, :params @@ -248,8 +248,7 @@ class IssuableFinder def filter_by_no_label? downcased = label_names.map(&:downcase) - # Label::NONE is deprecated and should be removed in 12.0 - downcased.include?(FILTER_NONE) || downcased.include?(Label::NONE) + downcased.include?(FILTER_NONE) end def filter_by_any_label? @@ -449,8 +448,7 @@ class IssuableFinder # rubocop: enable CodeReuse/ActiveRecord def filter_by_no_assignee? - # Assignee_id takes precedence over assignee_username - [NONE, FILTER_NONE].include?(params[:assignee_id].to_s.downcase) || params[:assignee_username].to_s == NONE + params[:assignee_id].to_s.downcase == FILTER_NONE end def filter_by_any_assignee? diff --git a/app/models/broadcast_message.rb b/app/models/broadcast_message.rb index 18fe2a9624f..0fd8dca70b4 100644 --- a/app/models/broadcast_message.rb +++ b/app/models/broadcast_message.rb @@ -17,13 +17,11 @@ class BroadcastMessage < ApplicationRecord default_value_for :font, '#FFFFFF' CACHE_KEY = 'broadcast_message_current_json'.freeze - LEGACY_CACHE_KEY = 'broadcast_message_current'.freeze after_commit :flush_redis_cache def self.current messages = cache.fetch(CACHE_KEY, as: BroadcastMessage, expires_in: cache_expires_in) do - remove_legacy_cache_key current_and_future_messages end @@ -50,14 +48,6 @@ class BroadcastMessage < ApplicationRecord nil end - # This can be removed in GitLab 12.0+ - # The old cache key had an indefinite lifetime, and in an HA - # environment a one-shot migration would not work because the cache - # would be repopulated by a node that has not been upgraded. - def self.remove_legacy_cache_key - cache.expire(LEGACY_CACHE_KEY) - end - def active? started? && !ended? end @@ -84,6 +74,5 @@ class BroadcastMessage < ApplicationRecord def flush_redis_cache self.class.cache.expire(CACHE_KEY) - self.class.remove_legacy_cache_key end end diff --git a/app/models/label.rb b/app/models/label.rb index e9085e8bd25..b83e0862bab 100644 --- a/app/models/label.rb +++ b/app/models/label.rb @@ -13,7 +13,6 @@ class Label < ApplicationRecord cache_markdown_field :description, pipeline: :single_line DEFAULT_COLOR = '#428BCA' - NONE = 'no label' default_value_for :color, DEFAULT_COLOR diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb index bc0ec58bd24..f0f1101325d 100644 --- a/spec/features/issues_spec.rb +++ b/spec/features/issues_spec.rb @@ -208,7 +208,7 @@ describe 'Issues' do let(:issue) { @issue } it 'allows filtering by issues with no specified assignee' do - visit project_issues_path(project, assignee_id: IssuableFinder::NONE) + visit project_issues_path(project, assignee_id: IssuableFinder::FILTER_NONE) expect(page).to have_content 'foobar' expect(page).not_to have_content 'barbaz' diff --git a/spec/features/merge_requests/user_lists_merge_requests_spec.rb b/spec/features/merge_requests/user_lists_merge_requests_spec.rb index bd91fae1453..2dee0e26954 100644 --- a/spec/features/merge_requests/user_lists_merge_requests_spec.rb +++ b/spec/features/merge_requests/user_lists_merge_requests_spec.rb @@ -33,7 +33,7 @@ describe 'Merge requests > User lists merge requests' do end it 'filters on no assignee' do - visit_merge_requests(project, assignee_id: IssuableFinder::NONE) + visit_merge_requests(project, assignee_id: IssuableFinder::FILTER_NONE) expect(current_path).to eq(project_merge_requests_path(project)) expect(page).to have_content 'merge-test' diff --git a/spec/finders/issues_finder_spec.rb b/spec/finders/issues_finder_spec.rb index 89fdaceaa9f..bf38d083ca6 100644 --- a/spec/finders/issues_finder_spec.rb +++ b/spec/finders/issues_finder_spec.rb @@ -241,14 +241,6 @@ describe IssuesFinder do end end - context 'filtering by legacy No+Label' do - let(:params) { { label_name: Label::NONE } } - - it 'returns issues with no labels' do - expect(issues).to contain_exactly(issue1, issue3, issue4) - end - end - context 'filtering by any label' do let(:params) { { label_name: described_class::FILTER_ANY } } diff --git a/spec/models/broadcast_message_spec.rb b/spec/models/broadcast_message_spec.rb index 3ab013ddc0e..4d53e4aad8a 100644 --- a/spec/models/broadcast_message_spec.rb +++ b/spec/models/broadcast_message_spec.rb @@ -88,13 +88,6 @@ describe BroadcastMessage do expect(Rails.cache).not_to receive(:delete).with(described_class::CACHE_KEY) expect(described_class.current.length).to eq(0) end - - it 'clears the legacy cache key' do - create(:broadcast_message, :future) - - expect(Rails.cache).to receive(:delete).with(described_class::LEGACY_CACHE_KEY) - expect(described_class.current.length).to eq(0) - end end describe '#attributes' do @@ -164,7 +157,6 @@ describe BroadcastMessage do message = create(:broadcast_message) expect(Rails.cache).to receive(:delete).with(described_class::CACHE_KEY) - expect(Rails.cache).to receive(:delete).with(described_class::LEGACY_CACHE_KEY) message.flush_redis_cache end diff --git a/spec/requests/api/issues/issues_spec.rb b/spec/requests/api/issues/issues_spec.rb index 9b9cc778fb3..f32ffd1c77b 100644 --- a/spec/requests/api/issues/issues_spec.rb +++ b/spec/requests/api/issues/issues_spec.rb @@ -276,14 +276,6 @@ describe API::Issues do it 'returns issues with no assignee' do issue2 = create(:issue, author: user2, project: project) - get api('/issues', user), params: { assignee_id: 0, scope: 'all' } - - expect_paginated_array_response(issue2.id) - end - - it 'returns issues with no assignee' do - issue2 = create(:issue, author: user2, project: project) - get api('/issues', user), params: { assignee_id: 'None', scope: 'all' } expect_paginated_array_response(issue2.id) @@ -496,18 +488,6 @@ describe API::Issues do expect_paginated_array_response(closed_issue.id) end - - it 'returns an array of issues with no label when using the legacy No+Label filter' do - get api('/issues', user), params: { labels: 'No Label' } - - expect_paginated_array_response(closed_issue.id) - end - - it 'returns an array of issues with no label when using the legacy No+Label filter with labels param as array' do - get api('/issues', user), params: { labels: ['No Label'] } - - expect_paginated_array_response(closed_issue.id) - end end it 'returns an empty array if no issue matches milestone' do diff --git a/spec/support/shared_examples/finders/assignees_filter_shared_examples.rb b/spec/support/shared_examples/finders/assignees_filter_shared_examples.rb index 782a2d97746..a931c4df99f 100644 --- a/spec/support/shared_examples/finders/assignees_filter_shared_examples.rb +++ b/spec/support/shared_examples/finders/assignees_filter_shared_examples.rb @@ -20,12 +20,6 @@ shared_examples 'no assignee filter' do end it 'returns issuables not assigned to any assignee' do - params[:assignee_id] = 0 - - expect(issuables).to contain_exactly(*expected_issuables) - end - - it 'returns issuables not assigned to any assignee' do params[:assignee_id] = 'none' expect(issuables).to contain_exactly(*expected_issuables) |