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
b9b2d2cd
Commit
b9b2d2cd
authored
Mar 15, 2021
by
charlie ablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track epic update note via usage ping
- Add usage ping metrics files
parent
aa259ef5
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
117 additions
and
5 deletions
+117
-5
doc/development/usage_ping/dictionary.md
doc/development/usage_ping/dictionary.md
+24
-0
ee/app/models/ee/note.rb
ee/app/models/ee/note.rb
+4
-0
ee/app/services/ee/notes/update_service.rb
ee/app/services/ee/notes/update_service.rb
+2
-0
ee/changelogs/unreleased/292253-cablett-update-epic-note.yml
ee/changelogs/unreleased/292253-cablett-update-epic-note.yml
+5
-0
ee/config/metrics/counts_28d/20210314234202_g_project_management_users_updating_epic_notes_monthly.yml
..._project_management_users_updating_epic_notes_monthly.yml
+21
-0
ee/config/metrics/counts_7d/20210314234041_g_project_management_users_updating_epic_notes_weekly.yml
...g_project_management_users_updating_epic_notes_weekly.yml
+21
-0
ee/lib/gitlab/usage_data_counters/epic_activity_unique_counter.rb
...itlab/usage_data_counters/epic_activity_unique_counter.rb
+6
-1
ee/spec/lib/gitlab/usage_data_counters/epic_activity_unique_counter_spec.rb
.../usage_data_counters/epic_activity_unique_counter_spec.rb
+12
-0
ee/spec/services/ee/notes/update_service_spec.rb
ee/spec/services/ee/notes/update_service_spec.rb
+16
-4
lib/gitlab/usage_data_counters/known_events/epic_events.yml
lib/gitlab/usage_data_counters/known_events/epic_events.yml
+6
-0
No files found.
doc/development/usage_ping/dictionary.md
View file @
b9b2d2cd
...
...
@@ -9884,6 +9884,30 @@ Status: `implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_updating_epic_notes_monthly`
Counts of MAU updating epic notes
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210314234202_g_project_management_users_updating_epic_notes_monthly.yml
)
Group:
`group:product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_updating_epic_notes_weekly`
Counts of WAU updating epic notes
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210314234041_g_project_management_users_updating_epic_notes_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/models/ee/note.rb
View file @
b9b2d2cd
...
...
@@ -76,6 +76,10 @@ module EE
for_vulnerability?
||
super
end
def
usage_ping_track_updated_epic_note
(
user
)
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_note_updated_action
(
author:
user
)
if
for_epic?
end
private
def
system_note_for_epic?
...
...
ee/app/services/ee/notes/update_service.rb
View file @
b9b2d2cd
...
...
@@ -13,6 +13,8 @@ module EE
::
Gitlab
::
StatusPage
.
trigger_publish
(
project
,
current_user
,
updated_note
)
end
note
.
usage_ping_track_updated_epic_note
(
current_user
)
if
note
.
for_epic?
updated_note
end
end
...
...
ee/changelogs/unreleased/292253-cablett-update-epic-note.yml
0 → 100644
View file @
b9b2d2cd
---
title
:
Track epic comment updated
merge_request
:
56610
author
:
type
:
other
ee/config/metrics/counts_28d/20210314234202_g_project_management_users_updating_epic_notes_monthly.yml
0 → 100644
View file @
b9b2d2cd
---
# 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_epic_notes_monthly
description
:
Counts of MAU updating epic notes
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/56610
time_frame
:
28d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_7d/20210314234041_g_project_management_users_updating_epic_notes_weekly.yml
0 → 100644
View file @
b9b2d2cd
---
# 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_epic_notes_weekly
description
:
Counts of WAU updating epic notes
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/56610
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 @
b9b2d2cd
...
...
@@ -8,15 +8,20 @@ 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_NOTE_UPDATED
=
'g_project_management_users_updating_epic_notes'
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_NOTE_DESTROYED
=
'g_project_management_users_destroying_epic_notes'
class
<<
self
def
track_epic_created_action
(
author
:,
time:
Time
.
zone
.
now
)
track_unique_action
(
EPIC_CREATED
,
author
,
time
)
end
def
track_epic_note_updated_action
(
author
:,
time:
Time
.
zone
.
now
)
track_unique_action
(
EPIC_NOTE_UPDATED
,
author
,
time
)
end
def
track_epic_note_destroyed_action
(
author
:,
time:
Time
.
zone
.
now
)
track_unique_action
(
EPIC_NOTE_DESTROYED
,
author
,
time
)
end
...
...
ee/spec/lib/gitlab/usage_data_counters/epic_activity_unique_counter_spec.rb
View file @
b9b2d2cd
...
...
@@ -20,6 +20,18 @@ 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 note updated event'
do
def
track_action
(
params
)
described_class
.
track_epic_note_updated_action
(
**
params
)
end
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_NOTE_UPDATED
}
end
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
end
context
'for epic note destroyed event'
do
def
track_action
(
params
)
described_class
.
track_epic_note_destroyed_action
(
**
params
)
...
...
ee/spec/services/ee/notes/update_service_spec.rb
View file @
b9b2d2cd
...
...
@@ -10,11 +10,12 @@ RSpec.describe Notes::UpdateService do
create
(
:note_on_issue
,
project:
project
,
author:
user
)
end
let
(
:note_text
)
{
'text'
}
let
(
:opts
)
{
{
note:
note_text
}
}
subject
(
:service
)
{
described_class
.
new
(
project
,
user
,
opts
)
}
describe
'#execute'
do
let
(
:opts
)
{
{
note:
note_text
}
}
describe
'publish to status page'
do
let
(
:execute
)
{
service
.
execute
(
note
)
}
let
(
:issue_id
)
{
note
.
noteable_id
}
...
...
@@ -25,8 +26,6 @@ RSpec.describe Notes::UpdateService do
end
context
'for text-only update'
do
let
(
:note_text
)
{
'text'
}
include_examples
'trigger status page publish'
context
'without recognized emoji'
do
...
...
@@ -49,4 +48,17 @@ RSpec.describe Notes::UpdateService do
end
end
end
context
'for epics'
do
let_it_be
(
:epic
)
{
create
(
:epic
)
}
let_it_be
(
:note
)
{
create
(
:note
,
noteable:
epic
)
}
subject
(
:service
)
{
described_class
.
new
(
nil
,
user
,
opts
)
}
it
'tracks epic note creation'
do
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
to
receive
(
:track_epic_note_updated_action
).
with
(
author:
user
)
described_class
.
new
(
nil
,
user
,
opts
).
execute
(
note
)
end
end
end
lib/gitlab/usage_data_counters/known_events/epic_events.yml
View file @
b9b2d2cd
...
...
@@ -9,6 +9,12 @@
aggregation
:
daily
feature_flag
:
track_epics_activity
-
name
:
g_project_management_users_updating_epic_notes
category
:
epics_usage
redis_slot
:
project_management
aggregation
:
daily
feature_flag
:
track_epics_activity
-
name
:
g_project_management_users_destroying_epic_notes
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