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
Show 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 @@
class
Groups::LabelsController
<
Groups
::
ApplicationController
include
ToggleSubscriptionAction
include
ShowInheritedLabelsChecker
before_action
:label
,
only:
[
:edit
,
:update
,
:destroy
]
before_action
:authorize_admin_labels!
,
only:
[
:new
,
:create
,
:edit
,
:update
,
:destroy
]
...
...
@@ -112,7 +111,7 @@ class Groups::LabelsController < Groups::ApplicationController
current_user
,
group_id:
@group
.
id
,
only_group_labels:
options
[
:only_group_labels
],
include_ancestor_groups:
show_inherited_labels?
(
params
[
:include_ancestor_groups
])
,
include_ancestor_groups:
true
,
sort:
sort
,
subscribed:
options
[
:subscribed
],
include_descendant_groups:
options
[
:include_descendant_groups
],
...
...
app/controllers/projects/labels_controller.rb
View file @
9545cbed
...
...
@@ -2,7 +2,6 @@
class
Projects::LabelsController
<
Projects
::
ApplicationController
include
ToggleSubscriptionAction
include
ShowInheritedLabelsChecker
before_action
:check_issuables_available!
before_action
:label
,
only:
[
:edit
,
:update
,
:destroy
,
:promote
]
...
...
@@ -164,7 +163,7 @@ class Projects::LabelsController < Projects::ApplicationController
@available_labels
||=
LabelsFinder
.
new
(
current_user
,
project_id:
@project
.
id
,
include_ancestor_groups:
show_inherited_labels?
(
params
[
:include_ancestor_groups
])
,
include_ancestor_groups:
true
,
search:
params
[
:search
],
subscribed:
params
[
:subscribed
],
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
before
do
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
)
end
...
...
@@ -34,8 +32,8 @@ RSpec.describe Groups::LabelsController do
subgroup
.
add_owner
(
user
)
end
RSpec
.
shared_examples
'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
label_ids
=
json_response
.
map
{
|
label
|
label
[
'title'
]}
...
...
@@ -43,35 +41,6 @@ RSpec.describe Groups::LabelsController do
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
context
'external authorization'
do
subject
{
get
:index
,
params:
{
group_id:
group
.
to_param
}
}
...
...
spec/controllers/projects/labels_controller_spec.rb
View file @
9545cbed
...
...
@@ -84,8 +84,8 @@ RSpec.describe Projects::LabelsController do
create
(
:label_priority
,
project:
project
,
label:
subgroup_label_2
,
priority:
1
)
end
RSpec
.
shared_examples
'returns ancestor group labels'
do
it
'returns ancestor group labels'
,
:aggregate_failures
do
params
=
{
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
}
get
:index
,
params:
params
expect
(
assigns
(
:labels
)).
to
match_array
([
subgroup_label_1
]
+
group_labels
+
project_labels
)
...
...
@@ -93,40 +93,6 @@ RSpec.describe Projects::LabelsController do
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
def
list_labels
get
:index
,
params:
{
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
}
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