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
9545cbed
Commit
9545cbed
authored
Dec 21, 2020
by
Jarka Košanová
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove show_inherited_labels FF
- remove the FF - adjust specs - add changelog entry
parent
25d5aa8e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
98 deletions
+12
-98
app/controllers/concerns/show_inherited_labels_checker.rb
app/controllers/concerns/show_inherited_labels_checker.rb
+0
-11
app/controllers/groups/labels_controller.rb
app/controllers/groups/labels_controller.rb
+1
-2
app/controllers/projects/labels_controller.rb
app/controllers/projects/labels_controller.rb
+1
-2
config/feature_flags/development/show_inherited_labels.yml
config/feature_flags/development/show_inherited_labels.yml
+0
-8
spec/controllers/groups/labels_controller_spec.rb
spec/controllers/groups/labels_controller_spec.rb
+5
-36
spec/controllers/projects/labels_controller_spec.rb
spec/controllers/projects/labels_controller_spec.rb
+5
-39
No files found.
app/controllers/concerns/show_inherited_labels_checker.rb
deleted
100644 → 0
View file @
25d5aa8e
# frozen_string_literal: true
module
ShowInheritedLabelsChecker
extend
ActiveSupport
::
Concern
private
def
show_inherited_labels?
(
include_ancestor_groups
)
Feature
.
enabled?
(
:show_inherited_labels
,
@project
||
@group
,
default_enabled:
true
)
||
include_ancestor_groups
# rubocop:disable Gitlab/ModuleWithInstanceVariables
end
end
app/controllers/groups/labels_controller.rb
View file @
9545cbed
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
class
Groups::LabelsController
<
Groups
::
ApplicationController
class
Groups::LabelsController
<
Groups
::
ApplicationController
include
ToggleSubscriptionAction
include
ToggleSubscriptionAction
include
ShowInheritedLabelsChecker
before_action
:label
,
only:
[
:edit
,
:update
,
:destroy
]
before_action
:label
,
only:
[
:edit
,
:update
,
:destroy
]
before_action
:authorize_admin_labels!
,
only:
[
:new
,
:create
,
:edit
,
:update
,
:destroy
]
before_action
:authorize_admin_labels!
,
only:
[
:new
,
:create
,
:edit
,
:update
,
:destroy
]
...
@@ -112,7 +111,7 @@ class Groups::LabelsController < Groups::ApplicationController
...
@@ -112,7 +111,7 @@ class Groups::LabelsController < Groups::ApplicationController
current_user
,
current_user
,
group_id:
@group
.
id
,
group_id:
@group
.
id
,
only_group_labels:
options
[
:only_group_labels
],
only_group_labels:
options
[
:only_group_labels
],
include_ancestor_groups:
show_inherited_labels?
(
params
[
:include_ancestor_groups
])
,
include_ancestor_groups:
true
,
sort:
sort
,
sort:
sort
,
subscribed:
options
[
:subscribed
],
subscribed:
options
[
:subscribed
],
include_descendant_groups:
options
[
:include_descendant_groups
],
include_descendant_groups:
options
[
:include_descendant_groups
],
...
...
app/controllers/projects/labels_controller.rb
View file @
9545cbed
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
class
Projects::LabelsController
<
Projects
::
ApplicationController
class
Projects::LabelsController
<
Projects
::
ApplicationController
include
ToggleSubscriptionAction
include
ToggleSubscriptionAction
include
ShowInheritedLabelsChecker
before_action
:check_issuables_available!
before_action
:check_issuables_available!
before_action
:label
,
only:
[
:edit
,
:update
,
:destroy
,
:promote
]
before_action
:label
,
only:
[
:edit
,
:update
,
:destroy
,
:promote
]
...
@@ -164,7 +163,7 @@ class Projects::LabelsController < Projects::ApplicationController
...
@@ -164,7 +163,7 @@ class Projects::LabelsController < Projects::ApplicationController
@available_labels
||=
@available_labels
||=
LabelsFinder
.
new
(
current_user
,
LabelsFinder
.
new
(
current_user
,
project_id:
@project
.
id
,
project_id:
@project
.
id
,
include_ancestor_groups:
show_inherited_labels?
(
params
[
:include_ancestor_groups
])
,
include_ancestor_groups:
true
,
search:
params
[
:search
],
search:
params
[
:search
],
subscribed:
params
[
:subscribed
],
subscribed:
params
[
:subscribed
],
sort:
sort
).
execute
sort:
sort
).
execute
...
...
config/feature_flags/development/show_inherited_labels.yml
deleted
100644 → 0
View file @
25d5aa8e
---
name
:
show_inherited_labels
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/42960
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/267547
milestone
:
'
13.5'
type
:
development
group
:
group::project management
default_enabled
:
true
spec/controllers/groups/labels_controller_spec.rb
View file @
9545cbed
...
@@ -9,8 +9,6 @@ RSpec.describe Groups::LabelsController do
...
@@ -9,8 +9,6 @@ RSpec.describe Groups::LabelsController do
before
do
before
do
group
.
add_owner
(
user
)
group
.
add_owner
(
user
)
# by default FFs are enabled in specs so we turn it off
stub_feature_flags
(
show_inherited_labels:
false
)
sign_in
(
user
)
sign_in
(
user
)
end
end
...
@@ -34,41 +32,12 @@ RSpec.describe Groups::LabelsController do
...
@@ -34,41 +32,12 @@ RSpec.describe Groups::LabelsController do
subgroup
.
add_owner
(
user
)
subgroup
.
add_owner
(
user
)
end
end
RSpec
.
shared_examples
'returns ancestor group labels'
do
it
'returns ancestor group labels'
do
it
'returns ancestor group labels'
do
params
=
{
group_id:
subgroup
,
only_group_labels:
true
}
get
:index
,
params:
params
,
format: :json
get
:index
,
params:
params
,
format: :json
label_ids
=
json_response
.
map
{
|
label
|
label
[
'title'
]}
label_ids
=
json_response
.
map
{
|
label
|
label
[
'title'
]}
expect
(
label_ids
).
to
match_array
([
group_label_1
.
title
,
subgroup_label_1
.
title
])
expect
(
label_ids
).
to
match_array
([
group_label_1
.
title
,
subgroup_label_1
.
title
])
end
end
context
'when include_ancestor_groups true'
do
let
(
:params
)
{
{
group_id:
subgroup
,
include_ancestor_groups:
true
,
only_group_labels:
true
}
}
it_behaves_like
'returns ancestor group labels'
end
context
'when include_ancestor_groups false'
do
let
(
:params
)
{
{
group_id:
subgroup
,
only_group_labels:
true
}
}
it
'does not return ancestor group labels'
,
:aggregate_failures
do
get
:index
,
params:
params
,
format: :json
label_ids
=
json_response
.
map
{
|
label
|
label
[
'title'
]}
expect
(
label_ids
).
to
match_array
([
subgroup_label_1
.
title
])
expect
(
label_ids
).
not_to
include
([
group_label_1
.
title
])
end
end
context
'when show_inherited_labels enabled'
do
let
(
:params
)
{
{
group_id:
subgroup
}
}
before
do
stub_feature_flags
(
show_inherited_labels:
true
)
end
it_behaves_like
'returns ancestor group labels'
end
end
end
end
...
...
spec/controllers/projects/labels_controller_spec.rb
View file @
9545cbed
...
@@ -84,46 +84,12 @@ RSpec.describe Projects::LabelsController do
...
@@ -84,46 +84,12 @@ RSpec.describe Projects::LabelsController do
create
(
:label_priority
,
project:
project
,
label:
subgroup_label_2
,
priority:
1
)
create
(
:label_priority
,
project:
project
,
label:
subgroup_label_2
,
priority:
1
)
end
end
RSpec
.
shared_examples
'returns ancestor group labels'
do
it
'returns ancestor group labels'
,
:aggregate_failures
do
it
'returns ancestor group labels'
,
:aggregate_failures
do
params
=
{
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
}
get
:index
,
params:
params
get
:index
,
params:
params
expect
(
assigns
(
:labels
)).
to
match_array
([
subgroup_label_1
]
+
group_labels
+
project_labels
)
expect
(
assigns
(
:labels
)).
to
match_array
([
subgroup_label_1
]
+
group_labels
+
project_labels
)
expect
(
assigns
(
:prioritized_labels
)).
to
match_array
([
subgroup_label_2
]
+
group_priority_labels
+
project_priority_labels
)
expect
(
assigns
(
:prioritized_labels
)).
to
match_array
([
subgroup_label_2
]
+
group_priority_labels
+
project_priority_labels
)
end
end
context
'when show_inherited_labels disabled'
do
before
do
stub_feature_flags
(
show_inherited_labels:
false
)
end
context
'when include_ancestor_groups false'
do
let
(
:params
)
{
{
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
}
}
it
'does not return ancestor group labels'
,
:aggregate_failures
do
get
:index
,
params:
params
expect
(
assigns
(
:labels
)).
to
match_array
([
subgroup_label_1
]
+
project_labels
)
expect
(
assigns
(
:prioritized_labels
)).
to
match_array
([
subgroup_label_2
]
+
project_priority_labels
)
end
end
context
'when include_ancestor_groups true'
do
let
(
:params
)
{
{
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
,
include_ancestor_groups:
true
}
}
it_behaves_like
'returns ancestor group labels'
end
end
context
'when show_inherited_labels enabled'
do
let
(
:params
)
{
{
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
}
}
before
do
stub_feature_flags
(
show_inherited_labels:
true
)
end
it_behaves_like
'returns ancestor group labels'
end
end
end
end
...
...
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