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
58e73787
Commit
58e73787
authored
Mar 12, 2021
by
charlie ablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track epic title and description changes via usage ping
- Add usage ping metrics files
parent
4d713989
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
144 additions
and
9 deletions
+144
-9
ee/app/services/epics/update_service.rb
ee/app/services/epics/update_service.rb
+9
-9
ee/changelogs/unreleased/292253-cablett-track-epic-title-description-changes.yml
...d/292253-cablett-track-epic-title-description-changes.yml
+5
-0
ee/config/metrics/counts_28d/20210312101935_g_product_planning_epic_title_changed_monthly.yml
...2101935_g_product_planning_epic_title_changed_monthly.yml
+21
-0
ee/config/metrics/counts_28d/20210312102051_g_product_planning_epic_description_changed_monthly.yml
...1_g_product_planning_epic_description_changed_monthly.yml
+21
-0
ee/config/metrics/counts_7d/20210312101753_g_product_planning_epic_description_changed_weekly.yml
...53_g_product_planning_epic_description_changed_weekly.yml
+21
-0
ee/config/metrics/counts_7d/20210312101826_g_product_planning_epic_title_changed_weekly.yml
...12101826_g_product_planning_epic_title_changed_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
+12
-0
No files found.
ee/app/services/epics/update_service.rb
View file @
58e73787
...
...
@@ -94,15 +94,15 @@ module Epics
end
def
track_changes
(
epic
)
changes
=
epic
.
saved_changes
.
keys
#
if changes.include?(:title)
# ::Gitlab::UsageDataCounters::EpicActivityUniqueCounter.track_epic_title_updated
(author: current_user)
#
end
#
#
if changes.include?(:description)
# ::Gitlab::UsageDataCounters::EpicActivityUniqueCounter.track_epic_description_updated
(author: current_user)
#
end
changes
=
epic
.
saved_changes
.
keys
.
map
(
&
:to_sym
)
if
changes
.
include?
(
:title
)
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_title_changed_action
(
author:
current_user
)
end
if
changes
.
include?
(
:description
)
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_description_changed_action
(
author:
current_user
)
end
end
end
end
ee/changelogs/unreleased/292253-cablett-track-epic-title-description-changes.yml
0 → 100644
View file @
58e73787
---
title
:
Track epic title and description changes via usage ping
merge_request
:
56489
author
:
type
:
other
ee/config/metrics/counts_28d/20210312101935_g_product_planning_epic_title_changed_monthly.yml
0 → 100644
View file @
58e73787
---
# 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
:
g_project_management_epic_title_changed_monthly
description
:
Counts of MAU changing epic titles
product_section
:
dev
product_stage
:
plan
product_group
:
group:product planning
product_category
:
epics_usage
value_type
:
number
status
:
implemented
milestone
:
"
13.10"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56489
time_frame
:
28d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_28d/20210312102051_g_product_planning_epic_description_changed_monthly.yml
0 → 100644
View file @
58e73787
---
# 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
:
g_project_management_epic_description_changed_monthly
description
:
Counts of MAU changing epic descriptions
product_section
:
dev
product_stage
:
plan
product_group
:
group:product planning
product_category
:
epics_usage
value_type
:
number
status
:
implemented
milestone
:
"
13.10"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56489
time_frame
:
28d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_7d/20210312101753_g_product_planning_epic_description_changed_weekly.yml
0 → 100644
View file @
58e73787
---
# 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
:
g_project_management_epic_description_changed_weekly
description
:
Counts of WAU changing epic descriptions
product_section
:
dev
product_stage
:
plan
product_group
:
group:product planning
product_category
:
epics_usage
value_type
:
number
status
:
implemented
milestone
:
"
13.10"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56489
time_frame
:
7d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_7d/20210312101826_g_product_planning_epic_title_changed_weekly.yml
0 → 100644
View file @
58e73787
---
# 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
:
g_project_management_epic_title_changed_weekly
description
:
Counts of WAU changing epic titles
product_section
:
dev
product_stage
:
plan
product_group
:
group:product planning
product_category
:
epics_usage
value_type
:
number
status
:
implemented
milestone
:
"
13.10"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56489
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 @
58e73787
...
...
@@ -8,6 +8,8 @@ module Gitlab
# slot of issue events to allow data aggregation.
# More information in: https://gitlab.com/gitlab-org/gitlab/-/issues/322405
EPIC_CREATED
=
'g_project_management_epic_created'
EPIC_TITLE_CHANGED
=
'g_project_management_epic_title_changed'
EPIC_DESCRIPTION_CHANGED
=
'g_project_management_epic_description_changed'
EPIC_NOTE_CREATED
=
'g_project_management_users_creating_epic_notes'
EPIC_NOTE_UPDATED
=
'g_project_management_users_updating_epic_notes'
EPIC_NOTE_DESTROYED
=
'g_project_management_users_destroying_epic_notes'
...
...
@@ -22,6 +24,14 @@ module Gitlab
track_unique_action
(
EPIC_CREATED
,
author
,
time
)
end
def
track_epic_title_changed_action
(
author
:,
time:
Time
.
zone
.
now
)
track_unique_action
(
EPIC_TITLE_CHANGED
,
author
,
time
)
end
def
track_epic_description_changed_action
(
author
:,
time:
Time
.
zone
.
now
)
track_unique_action
(
EPIC_DESCRIPTION_CHANGED
,
author
,
time
)
end
def
track_epic_note_created_action
(
author
:,
time:
Time
.
zone
.
now
)
track_unique_action
(
EPIC_NOTE_CREATED
,
author
,
time
)
end
...
...
ee/spec/lib/gitlab/usage_data_counters/epic_activity_unique_counter_spec.rb
View file @
58e73787
...
...
@@ -20,6 +20,30 @@ RSpec.describe Gitlab::UsageDataCounters::EpicActivityUniqueCounter, :clean_gitl
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
end
context
'for epic title changed event'
do
def
track_action
(
params
)
described_class
.
track_epic_title_changed_action
(
**
params
)
end
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_TITLE_CHANGED
}
end
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
end
context
'for epic description changed event'
do
def
track_action
(
params
)
described_class
.
track_epic_description_changed_action
(
**
params
)
end
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_DESCRIPTION_CHANGED
}
end
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
end
context
'for epic note created event'
do
def
track_action
(
params
)
described_class
.
track_epic_note_created_action
(
**
params
)
...
...
ee/spec/services/epics/update_service_spec.rb
View file @
58e73787
...
...
@@ -71,6 +71,12 @@ RSpec.describe Epics::UpdateService do
expect
(
note
.
note
).
to
start_with
(
'changed title'
)
expect
(
note
.
noteable
).
to
eq
(
epic
)
end
it
'records epic title changed after saving'
do
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
to
receive
(
:track_epic_title_changed_action
)
update_epic
(
title:
'New title'
)
end
end
context
'when description has changed'
do
...
...
@@ -82,6 +88,12 @@ RSpec.describe Epics::UpdateService do
expect
(
note
.
note
).
to
start_with
(
'changed the description'
)
expect
(
note
.
noteable
).
to
eq
(
epic
)
end
it
'records epic description changed after saving'
do
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
to
receive
(
:track_epic_description_changed_action
)
update_epic
(
description:
'New description'
)
end
end
context
'when repositioning an epic on a board'
do
...
...
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