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
e065925a
Commit
e065925a
authored
Apr 21, 2021
by
Jarka Košanová
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track checking epic tasks on usage data
parent
4ea44cb1
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
227 additions
and
9 deletions
+227
-9
changelogs/unreleased/292253-epic-task-epic-descr.yml
changelogs/unreleased/292253-epic-task-epic-descr.yml
+5
-0
doc/development/usage_ping/dictionary.md
doc/development/usage_ping/dictionary.md
+52
-2
ee/app/services/epics/update_service.rb
ee/app/services/epics/update_service.rb
+13
-0
ee/config/metrics/counts_28d/20210421080207_g_project_management_users_checking_epic_task_monthly.yml
...g_project_management_users_checking_epic_task_monthly.yml
+21
-0
ee/config/metrics/counts_28d/20210421102516_g_project_management_users_unchecking_epic_task_monthly.yml
...project_management_users_unchecking_epic_task_monthly.yml
+21
-0
ee/config/metrics/counts_7d/20210421075943_g_project_management_users_checking_epic_task_weekly.yml
..._g_project_management_users_checking_epic_task_weekly.yml
+21
-0
ee/config/metrics/counts_7d/20210421102812_g_project_management_users_unchecking_epic_task_weekly.yml
..._project_management_users_unchecking_epic_task_weekly.yml
+21
-0
ee/lib/gitlab/usage_data_counters/epic_activity_unique_counter.rb
...itlab/usage_data_counters/epic_activity_unique_counter.rb
+10
-0
ee/spec/lib/gitlab/usage_data_counters/epic_activity_unique_counter_spec.rb
.../usage_data_counters/epic_activity_unique_counter_spec.rb
+24
-0
ee/spec/services/epics/update_service_spec.rb
ee/spec/services/epics/update_service_spec.rb
+20
-7
lib/gitlab/usage_data_counters/known_events/epic_events.yml
lib/gitlab/usage_data_counters/known_events/epic_events.yml
+14
-0
spec/support/shared_examples/services/issuable_shared_examples.rb
...port/shared_examples/services/issuable_shared_examples.rb
+5
-0
No files found.
changelogs/unreleased/292253-epic-task-epic-descr.yml
0 → 100644
View file @
e065925a
---
title
:
Track checking/unchecking tasks on epics
merge_request
:
59871
author
:
type
:
added
doc/development/usage_ping/dictionary.md
View file @
e065925a
...
@@ -1016,6 +1016,54 @@ Status: `data_available`
...
@@ -1016,6 +1016,54 @@ Status: `data_available`
Tiers: `free`
Tiers: `free`
### `counts.g_project_management_users_checking_epic_task_monthly`
Counts of MAU checking epic task
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210421080207_g_project_management_users_checking_epic_task_monthly.yml)
Group: `group::product planning`
Status: `implemented`
Tiers: `premium`, `ultimate`
### `counts.g_project_management_users_checking_epic_task_weekly`
Counts of WAU checking epic task
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210421075943_g_project_management_users_checking_epic_task_weekly.yml)
Group: `group::product planning`
Status: `implemented`
Tiers: `premium`, `ultimate`
### `counts.g_project_management_users_unchecking_epic_task_monthly`
Counts of MAU unchecking epic task
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210421102516_g_project_management_users_unchecking_epic_task_monthly.yml)
Group: `group::product planning`
Status: `implemented`
Tiers: `premium`, `ultimate`
### `counts.g_project_management_users_unchecking_epic_task_weekly`
Counts of WAU unchecking epic task
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210421102812_g_project_management_users_unchecking_epic_task_weekly.yml)
Group: `group::product planning`
Status: `implemented`
Tiers: `premium`, `ultimate`
### `counts.geo_event_log_max_id`
### `counts.geo_event_log_max_id`
Number of replication events on a Geo primary
Number of replication events on a Geo primary
...
@@ -6346,7 +6394,7 @@ Tiers: `free`, `premium`, `ultimate`
...
@@ -6346,7 +6394,7 @@ Tiers: `free`, `premium`, `ultimate`
### `database.pg_system_id`
### `database.pg_system_id`
Missing description
TBD
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216183248_pg_system_id.yml
)
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216183248_pg_system_id.yml
)
...
@@ -7680,7 +7728,7 @@ Tiers: `free`, `premium`, `ultimate`
...
@@ -7680,7 +7728,7 @@ Tiers: `free`, `premium`, `ultimate`
Number of projects using 5 min production app CI template in last 7 days.
Number of projects using 5 min production app CI template in last 7 days.
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/
ee/
config/metrics/counts_7d/20210216184515_p_ci_templates_5_min_production_app_weekly.yml
)
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_7d/20210216184515_p_ci_templates_5_min_production_app_weekly.yml
)
Group:
`group::5-min-app`
Group:
`group::5-min-app`
...
@@ -15926,6 +15974,8 @@ Tiers: `free`
...
@@ -15926,6 +15974,8 @@ Tiers: `free`
Histogram (buckets 1 to 100) of projects with at least 1 enabled integration.
Histogram (buckets 1 to 100) of projects with at least 1 enabled integration.
[
Object JSON schema
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/objects_schemas/projects_with_enabled_alert_integrations_histogram.json
)
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210309165717_projects_with_enabled_alert_integrations_histogram.yml
)
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210309165717_projects_with_enabled_alert_integrations_histogram.yml
)
Group:
`group::monitor`
Group:
`group::monitor`
...
...
ee/app/services/epics/update_service.rb
View file @
e065925a
...
@@ -135,6 +135,19 @@ module Epics
...
@@ -135,6 +135,19 @@ module Epics
if
epic
.
saved_change_to_attribute?
(
:description
)
if
epic
.
saved_change_to_attribute?
(
:description
)
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_description_changed_action
(
author:
current_user
)
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_description_changed_action
(
author:
current_user
)
track_task_changes
(
epic
)
end
end
def
track_task_changes
(
epic
)
return
if
epic
.
updated_tasks
.
blank?
epic
.
updated_tasks
.
each
do
|
task
|
if
task
.
complete?
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_task_checked
(
author:
current_user
)
else
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_task_unchecked
(
author:
current_user
)
end
end
end
end
end
end
end
...
...
ee/config/metrics/counts_28d/20210421080207_g_project_management_users_checking_epic_task_monthly.yml
0 → 100644
View file @
e065925a
---
# Name of this metric contains g_project_management prefix
# because we are using the same slot from issue_tracking to
# allow data aggregation.
key_path
:
counts.g_project_management_users_checking_epic_task_monthly
description
:
Counts of MAU checking epic task
product_section
:
dev
product_stage
:
plan
product_group
:
group::product planning
product_category
:
epics
value_type
:
number
status
:
implemented
milestone
:
"
13.12"
introduced_by_url
:
time_frame
:
28d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
\ No newline at end of file
ee/config/metrics/counts_28d/20210421102516_g_project_management_users_unchecking_epic_task_monthly.yml
0 → 100644
View file @
e065925a
---
# Name of this metric contains g_project_management prefix
# because we are using the same slot from issue_tracking to
# allow data aggregation.
key_path
:
counts.g_project_management_users_unchecking_epic_task_monthly
description
:
Counts of MAU unchecking epic task
product_section
:
dev
product_stage
:
plan
product_group
:
group::product planning
product_category
:
epics
value_type
:
number
status
:
implemented
milestone
:
"
13.12"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/59871
time_frame
:
28d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
\ No newline at end of file
ee/config/metrics/counts_7d/20210421075943_g_project_management_users_checking_epic_task_weekly.yml
0 → 100644
View file @
e065925a
---
# Name of this metric contains g_project_management prefix
# because we are using the same slot from issue_tracking to
# allow data aggregation.
key_path
:
counts.g_project_management_users_checking_epic_task_weekly
description
:
Counts of WAU checking epic task
product_section
:
dev
product_stage
:
plan
product_group
:
group::product planning
product_category
:
epics
value_type
:
number
status
:
implemented
milestone
:
"
13.12"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/59871
time_frame
:
7d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
\ No newline at end of file
ee/config/metrics/counts_7d/20210421102812_g_project_management_users_unchecking_epic_task_weekly.yml
0 → 100644
View file @
e065925a
---
# Name of this metric contains g_project_management prefix
# because we are using the same slot from issue_tracking to
# allow data aggregation.
key_path
:
counts.g_project_management_users_unchecking_epic_task_weekly
description
:
Counts of WAU unchecking epic task
product_section
:
dev
product_stage
:
plan
product_group
:
group::product planning
product_category
:
epics
value_type
:
number
status
:
implemented
milestone
:
"
13.12"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/59871
time_frame
:
7d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/lib/gitlab/usage_data_counters/epic_activity_unique_counter.rb
View file @
e065925a
...
@@ -29,6 +29,8 @@ module Gitlab
...
@@ -29,6 +29,8 @@ module Gitlab
EPIC_VISIBLE
=
'g_project_management_users_setting_epic_visible'
EPIC_VISIBLE
=
'g_project_management_users_setting_epic_visible'
EPIC_LABELS
=
'g_project_management_epic_users_changing_labels'
EPIC_LABELS
=
'g_project_management_epic_users_changing_labels'
EPIC_DESTROYED
=
'g_project_management_epic_destroyed'
EPIC_DESTROYED
=
'g_project_management_epic_destroyed'
EPIC_TASK_CHECKED
=
'project_management_users_checking_epic_task'
EPIC_TASK_UNCHECKED
=
'project_management_users_unchecking_epic_task'
class
<<
self
class
<<
self
def
track_epic_created_action
(
author
:)
def
track_epic_created_action
(
author
:)
...
@@ -119,6 +121,14 @@ module Gitlab
...
@@ -119,6 +121,14 @@ module Gitlab
track_unique_action
(
EPIC_DESTROYED
,
author
)
track_unique_action
(
EPIC_DESTROYED
,
author
)
end
end
def
track_epic_task_checked
(
author
:)
track_unique_action
(
EPIC_TASK_CHECKED
,
author
)
end
def
track_epic_task_unchecked
(
author
:)
track_unique_action
(
EPIC_TASK_UNCHECKED
,
author
)
end
private
private
def
track_unique_action
(
action
,
author
)
def
track_unique_action
(
action
,
author
)
...
...
ee/spec/lib/gitlab/usage_data_counters/epic_activity_unique_counter_spec.rb
View file @
e065925a
...
@@ -269,4 +269,28 @@ RSpec.describe Gitlab::UsageDataCounters::EpicActivityUniqueCounter, :clean_gitl
...
@@ -269,4 +269,28 @@ RSpec.describe Gitlab::UsageDataCounters::EpicActivityUniqueCounter, :clean_gitl
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
end
end
context
'for margin epic task as checked'
do
def
track_action
(
params
)
described_class
.
track_epic_task_checked
(
**
params
)
end
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_TASK_CHECKED
}
end
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
end
context
'for margin epic task as unchecked'
do
def
track_action
(
params
)
described_class
.
track_epic_task_unchecked
(
**
params
)
end
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_TASK_UNCHECKED
}
end
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
end
end
end
ee/spec/services/epics/update_service_spec.rb
View file @
e065925a
...
@@ -317,7 +317,7 @@ RSpec.describe Epics::UpdateService do
...
@@ -317,7 +317,7 @@ RSpec.describe Epics::UpdateService do
context
'when Epic has tasks'
do
context
'when Epic has tasks'
do
before
do
before
do
update_epic
(
{
description:
"- [ ] Task 1
\n
- [ ] Task 2"
}
)
update_epic
(
description:
"- [ ] Task 1
\n
- [ ] Task 2"
)
end
end
it
{
expect
(
epic
.
tasks?
).
to
eq
(
true
)
}
it
{
expect
(
epic
.
tasks?
).
to
eq
(
true
)
}
...
@@ -329,11 +329,9 @@ RSpec.describe Epics::UpdateService do
...
@@ -329,11 +329,9 @@ RSpec.describe Epics::UpdateService do
end
end
context
'when tasks are marked as completed'
do
context
'when tasks are marked as completed'
do
before
do
update_epic
({
description:
"- [x] Task 1
\n
- [X] Task 2"
})
end
it
'creates system note about task status change'
do
it
'creates system note about task status change'
do
update_epic
(
description:
"- [x] Task 1
\n
- [X] Task 2"
)
note1
=
find_note
(
'marked the task **Task 1** as completed'
)
note1
=
find_note
(
'marked the task **Task 1** as completed'
)
note2
=
find_note
(
'marked the task **Task 2** as completed'
)
note2
=
find_note
(
'marked the task **Task 2** as completed'
)
...
@@ -343,15 +341,23 @@ RSpec.describe Epics::UpdateService do
...
@@ -343,15 +341,23 @@ RSpec.describe Epics::UpdateService do
description_notes
=
find_notes
(
'description'
)
description_notes
=
find_notes
(
'description'
)
expect
(
description_notes
.
length
).
to
eq
(
1
)
expect
(
description_notes
.
length
).
to
eq
(
1
)
end
end
it
'counts the change correctly'
do
expect
(
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
to
receive
(
:track_epic_task_checked
)
.
with
(
author:
user
).
twice
update_epic
(
description:
"- [x] Task 1
\n
- [X] Task 2"
)
end
end
end
context
'when tasks are marked as incomplete'
do
context
'when tasks are marked as incomplete'
do
before
do
before
do
update_epic
({
description:
"- [x] Task 1
\n
- [X] Task 2"
})
update_epic
(
description:
"- [x] Task 1
\n
- [X] Task 2"
)
update_epic
({
description:
"- [ ] Task 1
\n
- [ ] Task 2"
})
end
end
it
'creates system note about task status change'
do
it
'creates system note about task status change'
do
update_epic
(
description:
"- [ ] Task 1
\n
- [ ] Task 2"
)
note1
=
find_note
(
'marked the task **Task 1** as incomplete'
)
note1
=
find_note
(
'marked the task **Task 1** as incomplete'
)
note2
=
find_note
(
'marked the task **Task 2** as incomplete'
)
note2
=
find_note
(
'marked the task **Task 2** as incomplete'
)
...
@@ -361,6 +367,13 @@ RSpec.describe Epics::UpdateService do
...
@@ -361,6 +367,13 @@ RSpec.describe Epics::UpdateService do
description_notes
=
find_notes
(
'description'
)
description_notes
=
find_notes
(
'description'
)
expect
(
description_notes
.
length
).
to
eq
(
1
)
expect
(
description_notes
.
length
).
to
eq
(
1
)
end
end
it
'counts the change correctly'
do
expect
(
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
to
receive
(
:track_epic_task_unchecked
)
.
with
(
author:
user
).
twice
update_epic
(
description:
"- [ ] Task 1
\n
- [ ] Task 2"
)
end
end
end
end
end
...
...
lib/gitlab/usage_data_counters/known_events/epic_events.yml
View file @
e065925a
...
@@ -9,6 +9,20 @@
...
@@ -9,6 +9,20 @@
aggregation
:
daily
aggregation
:
daily
feature_flag
:
track_epics_activity
feature_flag
:
track_epics_activity
# content change events
-
name
:
project_management_users_unchecking_epic_task
category
:
epics_usage
redis_slot
:
project_management
aggregation
:
daily
feature_flag
:
track_epics_activity
-
name
:
project_management_users_checking_epic_task
category
:
epics_usage
redis_slot
:
project_management
aggregation
:
daily
feature_flag
:
track_epics_activity
-
name
:
g_project_management_users_updating_epic_titles
-
name
:
g_project_management_users_updating_epic_titles
category
:
epics_usage
category
:
epics_usage
redis_slot
:
project_management
redis_slot
:
project_management
...
...
spec/support/shared_examples/services/issuable_shared_examples.rb
View file @
e065925a
...
@@ -23,9 +23,14 @@ RSpec.shared_examples 'updating a single task' do
...
@@ -23,9 +23,14 @@ RSpec.shared_examples 'updating a single task' do
if
try
(
:merge_request
)
if
try
(
:merge_request
)
expect
(
Gitlab
::
UsageDataCounters
::
MergeRequestActivityUniqueCounter
)
expect
(
Gitlab
::
UsageDataCounters
::
MergeRequestActivityUniqueCounter
)
.
to
receive
(
:track_task_item_status_changed
).
once
.
with
(
user:
user
)
.
to
receive
(
:track_task_item_status_changed
).
once
.
with
(
user:
user
)
elsif
try
(
:epic
)
expect
(
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
)
.
to
receive
(
:track_epic_task_checked
).
once
.
with
(
author:
user
)
else
else
expect
(
Gitlab
::
UsageDataCounters
::
MergeRequestActivityUniqueCounter
)
expect
(
Gitlab
::
UsageDataCounters
::
MergeRequestActivityUniqueCounter
)
.
not_to
receive
(
:track_task_item_status_changed
)
.
not_to
receive
(
:track_task_item_status_changed
)
expect
(
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
)
.
not_to
receive
(
:track_epic_task_checked
)
end
end
update_issuable
(
update_issuable
(
...
...
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