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
ad914d61
Commit
ad914d61
authored
Mar 29, 2021
by
charlie ablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track epic fixed dates manually updated
- add tests - add generated dictionary
parent
95bc54ae
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
210 additions
and
4 deletions
+210
-4
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
+19
-4
ee/changelogs/unreleased/292253-cablett-track-epic-date-changed.yml
...ogs/unreleased/292253-cablett-track-epic-date-changed.yml
+5
-0
ee/config/metrics/counts_28d/20210329043509_g_project_management_users_updating_fixed_epic_start_date_monthly.yml
...nagement_users_updating_fixed_epic_start_date_monthly.yml
+21
-0
ee/config/metrics/counts_28d/20210329043548_g_project_management_users_updating_fixed_epic_due_date_monthly.yml
...management_users_updating_fixed_epic_due_date_monthly.yml
+21
-0
ee/config/metrics/counts_7d/20210329042536_g_project_management_users_updating_fixed_epic_due_date_weekly.yml
..._management_users_updating_fixed_epic_due_date_weekly.yml
+21
-0
ee/config/metrics/counts_7d/20210329043402_g_project_management_users_updating_fixed_epic_start_date_weekly.yml
...anagement_users_updating_fixed_epic_start_date_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
+2
-0
lib/gitlab/usage_data_counters/known_events/epic_events.yml
lib/gitlab/usage_data_counters/known_events/epic_events.yml
+18
-0
No files found.
doc/development/usage_ping/dictionary.md
View file @
ad914d61
...
...
@@ -10124,6 +10124,54 @@ Status: `implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_updating_fixed_epic_due_date_monthly`
Counts of MAU manually updating fixed due date
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210329043548_g_project_management_users_updating_fixed_epic_due_date_monthly.yml
)
Group:
`group::product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_updating_fixed_epic_due_date_weekly`
Counts of WAU manually updating fixed due date
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210329042536_g_project_management_users_updating_fixed_epic_due_date_weekly.yml
)
Group:
`group::product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_updating_fixed_epic_start_date_monthly`
Counts of MAU manually updating fixed start date
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210329043509_g_project_management_users_updating_fixed_epic_start_date_monthly.yml
)
Group:
`group::product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_updating_fixed_epic_start_date_weekly`
Counts of WAU manually updating fixed start date
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210329043402_g_project_management_users_updating_fixed_epic_start_date_weekly.yml
)
Group:
`group::product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.ide_edit.g_edit_by_sfe_monthly`
Missing description
...
...
ee/app/services/epics/update_service.rb
View file @
ad914d61
...
...
@@ -23,6 +23,7 @@ module Epics
track_start_date_fixed_events
(
epic
)
track_due_date_fixed_events
(
epic
)
track_fixed_dates_updated_events
(
epic
)
epic
.
reset
end
...
...
@@ -59,8 +60,22 @@ module Epics
private
def
track_fixed_dates_updated_events
(
epic
)
fixed_start_date_updated
=
epic
.
saved_change_to_attribute?
(
:start_date_fixed
)
fixed_due_date_updated
=
epic
.
saved_change_to_attribute?
(
:due_date_fixed
)
return
unless
fixed_start_date_updated
||
fixed_due_date_updated
if
fixed_start_date_updated
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_fixed_start_date_updated_action
(
author:
current_user
)
end
if
fixed_due_date_updated
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_fixed_due_date_updated_action
(
author:
current_user
)
end
end
def
track_start_date_fixed_events
(
epic
)
return
unless
epic
.
saved_change
s
.
key?
(
'start_date_is_fixed'
)
return
unless
epic
.
saved_change
_to_attribute?
(
:start_date_is_fixed
)
if
epic
.
start_date_is_fixed?
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_start_date_set_as_fixed_action
(
author:
current_user
)
...
...
@@ -70,7 +85,7 @@ module Epics
end
def
track_due_date_fixed_events
(
epic
)
return
unless
epic
.
saved_change
s
.
key?
(
'due_date_is_fixed'
)
return
unless
epic
.
saved_change
_to_attribute?
(
:due_date_is_fixed
)
if
epic
.
due_date_is_fixed?
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_due_date_set_as_fixed_action
(
author:
current_user
)
...
...
@@ -105,11 +120,11 @@ module Epics
end
def
track_changes
(
epic
)
if
epic
.
saved_change
s
.
key?
(
'title'
)
if
epic
.
saved_change
_to_attribute?
(
:title
)
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_title_changed_action
(
author:
current_user
)
end
if
epic
.
saved_change
s
.
key?
(
'description'
)
if
epic
.
saved_change
_to_attribute?
(
:description
)
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_description_changed_action
(
author:
current_user
)
end
end
...
...
ee/changelogs/unreleased/292253-cablett-track-epic-date-changed.yml
0 → 100644
View file @
ad914d61
---
title
:
Track epic change to fixed start/due dates via usage ping
merge_request
:
57672
author
:
type
:
other
ee/config/metrics/counts_28d/20210329043509_g_project_management_users_updating_fixed_epic_start_date_monthly.yml
0 → 100644
View file @
ad914d61
---
# 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_updating_fixed_epic_start_date_monthly
description
:
Counts of MAU manually updating fixed start date
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/57672
time_frame
:
28d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_28d/20210329043548_g_project_management_users_updating_fixed_epic_due_date_monthly.yml
0 → 100644
View file @
ad914d61
---
# 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_updating_fixed_epic_due_date_monthly
description
:
Counts of MAU manually updating fixed due date
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/57672
time_frame
:
28d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_7d/20210329042536_g_project_management_users_updating_fixed_epic_due_date_weekly.yml
0 → 100644
View file @
ad914d61
---
# 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_updating_fixed_epic_due_date_weekly
description
:
Counts of WAU manually updating fixed due date
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/57672
time_frame
:
7d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_7d/20210329043402_g_project_management_users_updating_fixed_epic_start_date_weekly.yml
0 → 100644
View file @
ad914d61
---
# 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_updating_fixed_epic_start_date_weekly
description
:
Counts of WAU manually updating fixed start date
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/57672
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 @
ad914d61
...
...
@@ -17,6 +17,8 @@ module Gitlab
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_FIXED_START_DATE_UPDATED
=
'g_project_management_users_updating_fixed_epic_start_date'
EPIC_FIXED_DUE_DATE_UPDATED
=
'g_project_management_users_updating_fixed_epic_due_date'
EPIC_ISSUE_ADDED
=
'g_project_management_epic_issue_added'
EPIC_CLOSED
=
'g_project_management_epic_closed'
EPIC_REOPENED
=
'g_project_management_epic_reopened'
...
...
@@ -62,6 +64,14 @@ module Gitlab
track_unique_action
(
EPIC_DUE_DATE_SET_AS_INHERITED
,
author
)
end
def
track_epic_fixed_start_date_updated_action
(
author
:)
track_unique_action
(
EPIC_FIXED_START_DATE_UPDATED
,
author
)
end
def
track_epic_fixed_due_date_updated_action
(
author
:)
track_unique_action
(
EPIC_FIXED_DUE_DATE_UPDATED
,
author
)
end
def
track_epic_issue_added
(
author
:)
track_unique_action
(
EPIC_ISSUE_ADDED
,
author
)
end
...
...
ee/spec/lib/gitlab/usage_data_counters/epic_activity_unique_counter_spec.rb
View file @
ad914d61
...
...
@@ -112,6 +112,18 @@ RSpec.describe Gitlab::UsageDataCounters::EpicActivityUniqueCounter, :clean_gitl
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
end
context
'setting as fixed start date event'
do
def
track_action
(
params
)
described_class
.
track_epic_fixed_start_date_updated_action
(
**
params
)
end
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_FIXED_START_DATE_UPDATED
}
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
)
...
...
@@ -138,6 +150,18 @@ RSpec.describe Gitlab::UsageDataCounters::EpicActivityUniqueCounter, :clean_gitl
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
end
context
'setting as fixed due date event'
do
def
track_action
(
params
)
described_class
.
track_epic_fixed_due_date_updated_action
(
**
params
)
end
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_FIXED_DUE_DATE_UPDATED
}
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_due_date_set_as_inherited_action
(
**
params
)
...
...
ee/spec/services/epics/update_service_spec.rb
View file @
ad914d61
...
...
@@ -348,6 +348,7 @@ RSpec.describe Epics::UpdateService do
context
'epic start date fixed or inherited'
do
it
'tracks the user action to set as fixed'
do
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
to
receive
(
:track_epic_start_date_set_as_fixed_action
)
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
to
receive
(
:track_epic_fixed_start_date_updated_action
)
update_epic
(
start_date_is_fixed:
true
,
start_date_fixed:
Date
.
today
)
end
...
...
@@ -362,6 +363,7 @@ RSpec.describe Epics::UpdateService do
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
)
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
to
receive
(
:track_epic_fixed_due_date_updated_action
)
update_epic
(
due_date_is_fixed:
true
,
due_date_fixed:
Date
.
today
)
end
...
...
lib/gitlab/usage_data_counters/known_events/epic_events.yml
View file @
ad914d61
...
...
@@ -21,6 +21,8 @@
aggregation
:
daily
feature_flag
:
track_epics_activity
# epic notes
-
name
:
g_project_management_users_creating_epic_notes
category
:
epics_usage
redis_slot
:
project_management
...
...
@@ -39,24 +41,40 @@
aggregation
:
daily
feature_flag
:
track_epics_activity
# start date events
-
name
:
g_project_management_users_setting_epic_start_date_as_fixed
category
:
epics_usage
redis_slot
:
project_management
aggregation
:
daily
feature_flag
:
track_epics_activity
-
name
:
g_project_management_users_updating_fixed_epic_start_date
category
:
epics_usage
redis_slot
:
project_management
aggregation
:
daily
feature_flag
:
track_epics_activity
-
name
:
g_project_management_users_setting_epic_start_date_as_inherited
category
:
epics_usage
redis_slot
:
project_management
aggregation
:
daily
feature_flag
:
track_epics_activity
# due date events
-
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_updating_fixed_epic_due_date
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
...
...
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