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
f5c23403
Commit
f5c23403
authored
Mar 25, 2021
by
charlie ablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track epic due date as fixed/inherited via usage ping
- add tests - add generated dictionary
parent
71535a99
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
226 additions
and
14 deletions
+226
-14
doc/development/usage_ping/dictionary.md
doc/development/usage_ping/dictionary.md
+48
-0
ee/app/services/epics/update_service.rb
ee/app/services/epics/update_service.rb
+11
-0
ee/changelogs/unreleased/292253-cablett-epic-fixed-due-date.yml
...ngelogs/unreleased/292253-cablett-epic-fixed-due-date.yml
+5
-0
ee/config/metrics/counts_28d/20210325060315_g_project_management_users_setting_epic_due_date_as_inherited_monthly.yml
...ment_users_setting_epic_due_date_as_inherited_monthly.yml
+21
-0
ee/config/metrics/counts_28d/20210325060507_g_project_management_users_setting_epic_due_date_as_fixed_monthly.yml
...nagement_users_setting_epic_due_date_as_fixed_monthly.yml
+21
-0
ee/config/metrics/counts_7d/20210325060623_g_project_management_users_setting_epic_due_date_as_fixed_weekly.yml
...anagement_users_setting_epic_due_date_as_fixed_weekly.yml
+21
-0
ee/config/metrics/counts_7d/20210325060903_g_project_management_users_setting_epic_due_date_as_inherited_weekly.yml
...ement_users_setting_epic_due_date_as_inherited_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
+42
-14
ee/spec/services/epics/update_service_spec.rb
ee/spec/services/epics/update_service_spec.rb
+14
-0
lib/gitlab/usage_data_counters/known_events/epic_events.yml
lib/gitlab/usage_data_counters/known_events/epic_events.yml
+12
-0
No files found.
doc/development/usage_ping/dictionary.md
View file @
f5c23403
...
...
@@ -9956,6 +9956,54 @@ Status: `implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_setting_epic_due_date_as_fixed_monthly`
Counts of MAU setting epic due date as inherited
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210325060507_g_project_management_users_setting_epic_due_date_as_fixed_monthly.yml
)
Group:
`group::product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_setting_epic_due_date_as_fixed_weekly`
Counts of WAU setting epic due date as fixed
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210325060623_g_project_management_users_setting_epic_due_date_as_fixed_weekly.yml
)
Group:
`group::product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_setting_epic_due_date_as_inherited_monthly`
Counts of MAU setting epic due date as inherited
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210325060315_g_project_management_users_setting_epic_due_date_as_inherited_monthly.yml
)
Group:
`group::product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_setting_epic_due_date_as_inherited_weekly`
Counts of WAU setting epic due date as inherited
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210325060903_g_project_management_users_setting_epic_due_date_as_inherited_weekly.yml
)
Group:
`group::product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_setting_epic_start_date_as_fixed_monthly`
Counts of MAU setting epic start date as fixed
...
...
ee/app/services/epics/update_service.rb
View file @
f5c23403
...
...
@@ -22,6 +22,7 @@ module Epics
Epics
::
UpdateDatesService
.
new
([
epic
]).
execute
track_start_date_fixed_events
(
epic
)
track_due_date_fixed_events
(
epic
)
epic
.
reset
end
...
...
@@ -68,6 +69,16 @@ module Epics
end
end
def
track_due_date_fixed_events
(
epic
)
return
unless
epic
.
saved_changes
.
key?
(
'due_date_is_fixed'
)
if
epic
.
due_date_is_fixed?
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_due_date_set_as_fixed_action
(
author:
current_user
)
else
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_due_date_set_as_inherited_action
(
author:
current_user
)
end
end
def
reposition_on_board
(
epic
)
return
unless
params
[
:move_between_ids
]
return
unless
params
[
positioning_scope_key
]
...
...
ee/changelogs/unreleased/292253-cablett-epic-fixed-due-date.yml
0 → 100644
View file @
f5c23403
---
title
:
Track epic due date set to fixed or inherited via usage ping
merge_request
:
57457
author
:
type
:
other
ee/config/metrics/counts_28d/20210325060315_g_project_management_users_setting_epic_due_date_as_inherited_monthly.yml
0 → 100644
View file @
f5c23403
---
# 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
:
redis_hll_counters.epics_usage.g_project_management_users_setting_epic_due_date_as_inherited_monthly
description
:
Counts of MAU setting epic due date as inherited
product_section
:
dev
product_stage
:
plan
product_group
:
group::product planning
product_category
:
epics_usage
value_type
:
number
status
:
implemented
milestone
:
"
13.11"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57457
time_frame
:
28d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_28d/20210325060507_g_project_management_users_setting_epic_due_date_as_fixed_monthly.yml
0 → 100644
View file @
f5c23403
---
# 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
:
redis_hll_counters.epics_usage.g_project_management_users_setting_epic_due_date_as_fixed_monthly
description
:
Counts of MAU setting epic due date as inherited
product_section
:
dev
product_stage
:
plan
product_group
:
group::product planning
product_category
:
epics_usage
value_type
:
number
status
:
implemented
milestone
:
"
13.11"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57457
time_frame
:
28d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_7d/20210325060623_g_project_management_users_setting_epic_due_date_as_fixed_weekly.yml
0 → 100644
View file @
f5c23403
---
# 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
:
redis_hll_counters.epics_usage.g_project_management_users_setting_epic_due_date_as_fixed_weekly
description
:
Counts of WAU setting epic due date as fixed
product_section
:
dev
product_stage
:
plan
product_group
:
group::product planning
product_category
:
epics_usage
value_type
:
number
status
:
implemented
milestone
:
"
13.11"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57457
time_frame
:
7d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_7d/20210325060903_g_project_management_users_setting_epic_due_date_as_inherited_weekly.yml
0 → 100644
View file @
f5c23403
---
# 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
:
redis_hll_counters.epics_usage.g_project_management_users_setting_epic_due_date_as_inherited_weekly
description
:
Counts of WAU setting epic due date as inherited
product_section
:
dev
product_stage
:
plan
product_group
:
group::product planning
product_category
:
epics_usage
value_type
:
number
status
:
implemented
milestone
:
"
13.11"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57457
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 @
f5c23403
...
...
@@ -15,6 +15,8 @@ module Gitlab
EPIC_NOTE_DESTROYED
=
'g_project_management_users_destroying_epic_notes'
EPIC_START_DATE_SET_AS_FIXED
=
'g_project_management_users_setting_epic_start_date_as_fixed'
EPIC_START_DATE_SET_AS_INHERITED
=
'g_project_management_users_setting_epic_start_date_as_inherited'
EPIC_DUE_DATE_SET_AS_FIXED
=
'g_project_management_users_setting_epic_due_date_as_fixed'
EPIC_DUE_DATE_SET_AS_INHERITED
=
'g_project_management_users_setting_epic_due_date_as_inherited'
EPIC_ISSUE_ADDED
=
'g_project_management_epic_issue_added'
EPIC_CLOSED
=
'g_project_management_epic_closed'
EPIC_REOPENED
=
'g_project_management_epic_reopened'
...
...
@@ -52,6 +54,14 @@ module Gitlab
track_unique_action
(
EPIC_START_DATE_SET_AS_INHERITED
,
author
,
time
)
end
def
track_epic_due_date_set_as_fixed_action
(
author
:,
time:
Time
.
zone
.
now
)
track_unique_action
(
EPIC_DUE_DATE_SET_AS_FIXED
,
author
,
time
)
end
def
track_epic_due_date_set_as_inherited_action
(
author
:,
time:
Time
.
zone
.
now
)
track_unique_action
(
EPIC_DUE_DATE_SET_AS_INHERITED
,
author
,
time
)
end
def
track_epic_issue_added
(
author
:,
time:
Time
.
zone
.
now
)
track_unique_action
(
EPIC_ISSUE_ADDED
,
author
,
time
)
end
...
...
ee/spec/lib/gitlab/usage_data_counters/epic_activity_unique_counter_spec.rb
View file @
f5c23403
...
...
@@ -101,28 +101,56 @@ RSpec.describe Gitlab::UsageDataCounters::EpicActivityUniqueCounter, :clean_gitl
end
context
'for epic date modification events'
do
context
'setting start date as fixed event'
do
def
track_action
(
params
)
described_class
.
track_epic_start_date_set_as_fixed_action
(
**
params
)
end
context
'start date'
do
context
'setting as fixed event'
do
def
track_action
(
params
)
described_class
.
track_epic_start_date_set_as_fixed_action
(
**
params
)
end
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_START_DATE_SET_AS_FIXED
}
end
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_START_DATE_SET_AS_FIXED
}
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
end
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
end
context
'setting as inherited event'
do
def
track_action
(
params
)
described_class
.
track_epic_start_date_set_as_inherited_action
(
**
params
)
end
context
'setting start date as inherited event'
do
def
track_action
(
params
)
described_class
.
track_epic_start_date_set_as_inherited_action
(
**
params
)
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_START_DATE_SET_AS_INHERITED
}
end
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
end
end
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_START_DATE_SET_AS_INHERITED
}
context
'due date'
do
context
'setting as fixed event'
do
def
track_action
(
params
)
described_class
.
track_epic_due_date_set_as_fixed_action
(
**
params
)
end
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_DUE_DATE_SET_AS_FIXED
}
end
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
end
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
context
'setting as inherited event'
do
def
track_action
(
params
)
described_class
.
track_epic_due_date_set_as_inherited_action
(
**
params
)
end
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_DUE_DATE_SET_AS_INHERITED
}
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 @
f5c23403
...
...
@@ -359,6 +359,20 @@ RSpec.describe Epics::UpdateService do
end
end
context
'epic due date fixed or inherited'
do
it
'tracks the user action to set as fixed'
do
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
to
receive
(
:track_epic_due_date_set_as_fixed_action
)
update_epic
(
due_date_is_fixed:
true
,
due_date_fixed:
Date
.
today
)
end
it
'tracks the user action to set as inherited'
do
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
to
receive
(
:track_epic_due_date_set_as_inherited_action
)
update_epic
(
due_date_is_fixed:
false
)
end
end
context
'date fields are not updated'
do
it
'does not call UpdateDatesService'
do
expect
(
Epics
::
UpdateDatesService
).
not_to
receive
(
:new
)
...
...
lib/gitlab/usage_data_counters/known_events/epic_events.yml
View file @
f5c23403
...
...
@@ -51,6 +51,18 @@
aggregation
:
daily
feature_flag
:
track_epics_activity
-
name
:
g_project_management_users_setting_epic_due_date_as_fixed
category
:
epics_usage
redis_slot
:
project_management
aggregation
:
daily
feature_flag
:
track_epics_activity
-
name
:
g_project_management_users_setting_epic_due_date_as_inherited
category
:
epics_usage
redis_slot
:
project_management
aggregation
:
daily
feature_flag
:
track_epics_activity
-
name
:
g_project_management_epic_issue_added
category
:
epics_usage
redis_slot
:
project_management
...
...
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