Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
15ba85ab
Commit
15ba85ab
authored
Jun 05, 2019
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove some deprecated code
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
bb491910
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
5 additions
and
61 deletions
+5
-61
app/finders/issuable_finder.rb
app/finders/issuable_finder.rb
+3
-5
app/models/broadcast_message.rb
app/models/broadcast_message.rb
+0
-11
app/models/label.rb
app/models/label.rb
+0
-1
spec/features/issues_spec.rb
spec/features/issues_spec.rb
+1
-1
spec/features/merge_requests/user_lists_merge_requests_spec.rb
...features/merge_requests/user_lists_merge_requests_spec.rb
+1
-1
spec/finders/issues_finder_spec.rb
spec/finders/issues_finder_spec.rb
+0
-8
spec/models/broadcast_message_spec.rb
spec/models/broadcast_message_spec.rb
+0
-8
spec/requests/api/issues/issues_spec.rb
spec/requests/api/issues/issues_spec.rb
+0
-20
spec/support/shared_examples/finders/assignees_filter_shared_examples.rb
...ared_examples/finders/assignees_filter_shared_examples.rb
+0
-6
No files found.
app/finders/issuable_finder.rb
View file @
15ba85ab
...
...
@@ -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?
...
...
app/models/broadcast_message.rb
View file @
15ba85ab
...
...
@@ -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
app/models/label.rb
View file @
15ba85ab
...
...
@@ -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
...
...
spec/features/issues_spec.rb
View file @
15ba85ab
...
...
@@ -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'
...
...
spec/features/merge_requests/user_lists_merge_requests_spec.rb
View file @
15ba85ab
...
...
@@ -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'
...
...
spec/finders/issues_finder_spec.rb
View file @
15ba85ab
...
...
@@ -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
}
}
...
...
spec/models/broadcast_message_spec.rb
View file @
15ba85ab
...
...
@@ -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
...
...
spec/requests/api/issues/issues_spec.rb
View file @
15ba85ab
...
...
@@ -273,14 +273,6 @@ describe API::Issues do
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:
0
,
scope:
'all'
}
expect_paginated_array_response
(
issue2
.
id
)
end
it
'returns issues with no assignee'
do
issue2
=
create
(
:issue
,
author:
user2
,
project:
project
)
...
...
@@ -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
...
...
spec/support/shared_examples/finders/assignees_filter_shared_examples.rb
View file @
15ba85ab
...
...
@@ -19,12 +19,6 @@ shared_examples 'no assignee filter' do
expect
(
issuables
).
to
contain_exactly
(
*
expected_issuables
)
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'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment