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
b49c7b8b
Commit
b49c7b8b
authored
Apr 21, 2020
by
Adam Hegyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove tasks_by_type_chart feature flag
parent
0138be44
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
15 additions
and
62 deletions
+15
-62
ee/app/controllers/analytics/tasks_by_type_controller.rb
ee/app/controllers/analytics/tasks_by_type_controller.rb
+0
-2
ee/changelogs/unreleased/remove-tasks-by-type-chart-ff.yml
ee/changelogs/unreleased/remove-tasks-by-type-chart-ff.yml
+5
-0
ee/config/routes/analytics.rb
ee/config/routes/analytics.rb
+3
-5
ee/config/routes/group.rb
ee/config/routes/group.rb
+6
-6
ee/lib/gitlab/analytics.rb
ee/lib/gitlab/analytics.rb
+1
-3
ee/spec/controllers/analytics/tasks_by_type_controller_spec.rb
...ec/controllers/analytics/tasks_by_type_controller_spec.rb
+0
-13
ee/spec/controllers/groups/analytics/tasks_by_type_controller_spec.rb
...rollers/groups/analytics/tasks_by_type_controller_spec.rb
+0
-13
ee/spec/features/analytics/cycle_analytics/cycle_analytics_spec.rb
...eatures/analytics/cycle_analytics/cycle_analytics_spec.rb
+0
-19
ee/spec/frontend/fixtures/analytics.rb
ee/spec/frontend/fixtures/analytics.rb
+0
-1
No files found.
ee/app/controllers/analytics/tasks_by_type_controller.rb
View file @
b49c7b8b
# frozen_string_literal: true
class
Analytics::TasksByTypeController
<
Analytics
::
ApplicationController
check_feature_flag
Gitlab
::
Analytics
::
TASKS_BY_TYPE_CHART_FEATURE_FLAG
before_action
:load_group
before_action
->
{
check_feature_availability!
(
:type_of_work_analytics
)
}
before_action
->
{
authorize_view_by_action!
(
:view_type_of_work_charts
)
}
...
...
ee/changelogs/unreleased/remove-tasks-by-type-chart-ff.yml
0 → 100644
View file @
b49c7b8b
---
title
:
Remove tasks_by_type_chart feature flag
merge_request
:
30034
author
:
type
:
changed
ee/config/routes/analytics.rb
View file @
b49c7b8b
...
...
@@ -18,11 +18,9 @@ namespace :analytics do
get
'/cycle_analytics'
,
to:
redirect
(
'-/analytics/value_stream_analytics'
)
end
constraints
(
::
Constraints
::
FeatureConstrainer
.
new
(
Gitlab
::
Analytics
::
TASKS_BY_TYPE_CHART_FEATURE_FLAG
))
do
scope
:type_of_work
do
resource
:tasks_by_type
,
controller: :tasks_by_type
,
only: :show
do
get
:top_labels
end
end
end
end
ee/config/routes/group.rb
View file @
b49c7b8b
...
...
@@ -23,7 +23,9 @@ constraints(::Constraints::GroupUrlConstrainer.new) do
namespace
:analytics
do
resource
:productivity_analytics
,
only: :show
,
constraints:
->
(
req
)
{
Gitlab
::
Analytics
.
productivity_analytics_enabled?
}
constraints
(
::
Constraints
::
FeatureConstrainer
.
new
(
Gitlab
::
Analytics
::
CYCLE_ANALYTICS_FEATURE_FLAG
,
default_enabled:
Gitlab
::
Analytics
.
feature_enabled_by_default?
(
Gitlab
::
Analytics
::
CYCLE_ANALYTICS_FEATURE_FLAG
)))
do
feature_default_enabled
=
Gitlab
::
Analytics
.
feature_enabled_by_default?
(
Gitlab
::
Analytics
::
CYCLE_ANALYTICS_FEATURE_FLAG
)
constrainer
=
::
Constraints
::
FeatureConstrainer
.
new
(
Gitlab
::
Analytics
::
CYCLE_ANALYTICS_FEATURE_FLAG
,
default_enabled:
feature_default_enabled
)
constraints
(
constrainer
)
do
resource
:cycle_analytics
,
only: :show
,
path:
'value_stream_analytics'
scope
module: :cycle_analytics
,
as:
'cycle_analytics'
,
path:
'value_stream_analytics'
do
resources
:stages
,
only:
[
:index
,
:create
,
:update
,
:destroy
]
do
...
...
@@ -38,14 +40,12 @@ constraints(::Constraints::GroupUrlConstrainer.new) do
get
'/cycle_analytics'
,
to:
redirect
(
'-/analytics/value_stream_analytics'
)
end
constraints
(
::
Constraints
::
FeatureConstrainer
.
new
(
Gitlab
::
Analytics
::
TASKS_BY_TYPE_CHART_FEATURE_FLAG
))
do
scope
:type_of_work
do
resource
:tasks_by_type
,
controller: :tasks_by_type
,
only: :show
do
get
:top_labels
end
end
end
end
resource
:ldap
,
only:
[]
do
member
do
...
...
ee/lib/gitlab/analytics.rb
View file @
b49c7b8b
...
...
@@ -5,12 +5,10 @@ module Gitlab
# Normally each analytics feature should be guarded with a feature flag.
CYCLE_ANALYTICS_FEATURE_FLAG
=
:cycle_analytics
PRODUCTIVITY_ANALYTICS_FEATURE_FLAG
=
:productivity_analytics
TASKS_BY_TYPE_CHART_FEATURE_FLAG
=
:tasks_by_type_chart
FEATURE_FLAGS
=
[
CYCLE_ANALYTICS_FEATURE_FLAG
,
PRODUCTIVITY_ANALYTICS_FEATURE_FLAG
,
TASKS_BY_TYPE_CHART_FEATURE_FLAG
PRODUCTIVITY_ANALYTICS_FEATURE_FLAG
].
freeze
FEATURE_FLAG_DEFAULTS
=
{
...
...
ee/spec/controllers/analytics/tasks_by_type_controller_spec.rb
View file @
b49c7b8b
...
...
@@ -13,7 +13,6 @@ describe Analytics::TasksByTypeController do
before
do
stub_licensed_features
(
type_of_work_analytics:
true
)
stub_feature_flags
(
Gitlab
::
Analytics
::
TASKS_BY_TYPE_CHART_FEATURE_FLAG
=>
true
)
group
.
add_reporter
(
user
)
sign_in
(
user
)
...
...
@@ -52,18 +51,6 @@ describe Analytics::TasksByTypeController do
end
end
context
'when feature flag is disabled'
do
before
do
stub_feature_flags
(
Gitlab
::
Analytics
::
TASKS_BY_TYPE_CHART_FEATURE_FLAG
=>
false
)
end
it
'returns not_found as response'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
context
'when `created_after` parameter is invalid'
do
before
do
params
[
:created_after
]
=
'invalid_date'
...
...
ee/spec/controllers/groups/analytics/tasks_by_type_controller_spec.rb
View file @
b49c7b8b
...
...
@@ -10,7 +10,6 @@ describe Analytics::TasksByTypeController do
before
do
stub_licensed_features
(
type_of_work_analytics:
true
)
stub_feature_flags
(
Gitlab
::
Analytics
::
TASKS_BY_TYPE_CHART_FEATURE_FLAG
=>
true
)
group
.
add_reporter
(
user
)
sign_in
(
user
)
...
...
@@ -49,18 +48,6 @@ describe Analytics::TasksByTypeController do
end
end
context
'when feature flag is disabled'
do
before
do
stub_feature_flags
(
Gitlab
::
Analytics
::
TASKS_BY_TYPE_CHART_FEATURE_FLAG
=>
false
)
end
it
'returns not_found as response'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
context
'when `created_after` parameter is invalid'
do
before
do
params
[
:created_after
]
=
'invalid_date'
...
...
ee/spec/features/analytics/cycle_analytics/cycle_analytics_spec.rb
View file @
b49c7b8b
...
...
@@ -37,9 +37,6 @@ describe 'Group Value Stream Analytics', :js do
before
do
stub_licensed_features
(
cycle_analytics_for_groups:
true
)
# chart returns an error since theres no data
stub_feature_flags
(
Gitlab
::
Analytics
::
TASKS_BY_TYPE_CHART_FEATURE_FLAG
=>
false
)
group
.
add_owner
(
user
)
project
.
add_maintainer
(
user
)
...
...
@@ -355,7 +352,6 @@ describe 'Group Value Stream Analytics', :js do
context
'enabled'
do
before
do
stub_licensed_features
(
cycle_analytics_for_groups:
true
,
type_of_work_analytics:
true
)
stub_feature_flags
(
Gitlab
::
Analytics
::
TASKS_BY_TYPE_CHART_FEATURE_FLAG
=>
true
)
sign_in
(
user
)
end
...
...
@@ -400,21 +396,6 @@ describe 'Group Value Stream Analytics', :js do
end
end
end
context
'not enabled'
do
before
do
stub_feature_flags
(
Gitlab
::
Analytics
::
TASKS_BY_TYPE_CHART_FEATURE_FLAG
=>
false
)
visit
analytics_cycle_analytics_path
select_group
end
it
'will not display the tasks by type chart'
do
expect
(
page
).
not_to
have_selector
(
'.js-tasks-by-type-chart'
)
expect
(
page
).
not_to
have_text
(
'Tasks by type'
)
end
end
end
describe
'Customizable cycle analytics'
,
:js
do
...
...
ee/spec/frontend/fixtures/analytics.rb
View file @
b49c7b8b
...
...
@@ -220,7 +220,6 @@ describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do
end
stub_licensed_features
(
type_of_work_analytics:
true
)
stub_feature_flags
(
Gitlab
::
Analytics
::
TASKS_BY_TYPE_CHART_FEATURE_FLAG
=>
true
)
group
.
add_maintainer
(
user
)
...
...
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