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
4381c717
Commit
4381c717
authored
Apr 20, 2021
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track epic cross reference on usage ping
Record epic cross reference event
parent
cf5e9f0f
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
137 additions
and
2 deletions
+137
-2
app/services/system_notes/issuables_service.rb
app/services/system_notes/issuables_service.rb
+5
-2
doc/development/usage_ping/dictionary.md
doc/development/usage_ping/dictionary.md
+24
-0
ee/app/services/ee/system_notes/issuables_service.rb
ee/app/services/ee/system_notes/issuables_service.rb
+10
-0
ee/changelogs/unreleased/issue_292253-track_epic_cross_reference.yml
...gs/unreleased/issue_292253-track_epic_cross_reference.yml
+5
-0
ee/config/metrics/counts_28d/20210430174100_g_project_management_epic_cross_referenced_monthly.yml
...00_g_project_management_epic_cross_referenced_monthly.yml
+21
-0
ee/config/metrics/counts_7d/20210430173650_g_project_management_epic_cross_referenced_weekly.yml
...650_g_project_management_epic_cross_referenced_weekly.yml
+21
-0
ee/lib/gitlab/usage_data_counters/epic_activity_unique_counter.rb
...itlab/usage_data_counters/epic_activity_unique_counter.rb
+5
-0
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/system_notes/issuables_service_spec.rb
ee/spec/services/ee/system_notes/issuables_service_spec.rb
+28
-0
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.
app/services/system_notes/issuables_service.rb
View file @
4381c717
...
@@ -178,8 +178,7 @@ module SystemNotes
...
@@ -178,8 +178,7 @@ module SystemNotes
if
noteable
.
is_a?
(
ExternalIssue
)
if
noteable
.
is_a?
(
ExternalIssue
)
noteable
.
project
.
external_issue_tracker
.
create_cross_reference_note
(
noteable
,
mentioner
,
author
)
noteable
.
project
.
external_issue_tracker
.
create_cross_reference_note
(
noteable
,
mentioner
,
author
)
else
else
issue_activity_counter
.
track_issue_cross_referenced_action
(
author:
author
)
if
noteable
.
is_a?
(
Issue
)
track_cross_reference_action
create_note
(
NoteSummary
.
new
(
noteable
,
noteable
.
project
,
author
,
body
,
action:
'cross_reference'
))
create_note
(
NoteSummary
.
new
(
noteable
,
noteable
.
project
,
author
,
body
,
action:
'cross_reference'
))
end
end
end
end
...
@@ -414,6 +413,10 @@ module SystemNotes
...
@@ -414,6 +413,10 @@ module SystemNotes
def
issue_activity_counter
def
issue_activity_counter
Gitlab
::
UsageDataCounters
::
IssueActivityUniqueCounter
Gitlab
::
UsageDataCounters
::
IssueActivityUniqueCounter
end
end
def
track_cross_reference_action
issue_activity_counter
.
track_issue_cross_referenced_action
(
author:
author
)
if
noteable
.
is_a?
(
Issue
)
end
end
end
end
end
...
...
doc/development/usage_ping/dictionary.md
View file @
4381c717
...
@@ -10292,6 +10292,30 @@ Status: `data_available`
...
@@ -10292,6 +10292,30 @@ Status: `data_available`
Tiers:
`premium`
,
`ultimate`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_epic_cross_referenced_monthly`
Count of MAU cross referencing epics
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210430174100_g_project_management_epic_cross_referenced_monthly.yml
)
Group:
`group::product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_epic_cross_referenced_weekly`
Counts of WAU cross referencing epics
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210430173650_g_project_management_epic_cross_referenced_weekly.yml
)
Group:
`group::product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_epic_destroyed_monthly`
### `redis_hll_counters.epics_usage.g_project_management_epic_destroyed_monthly`
Count of MAU destroying epics
Count of MAU destroying epics
...
...
ee/app/services/ee/system_notes/issuables_service.rb
View file @
4381c717
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
module
EE
module
EE
module
SystemNotes
module
SystemNotes
module
IssuablesService
module
IssuablesService
extend
::
Gitlab
::
Utils
::
Override
# Called when the health_status of an Issue is changed
# Called when the health_status of an Issue is changed
#
#
# Example Note text:
# Example Note text:
...
@@ -33,6 +34,15 @@ module EE
...
@@ -33,6 +34,15 @@ module EE
create_note
(
NoteSummary
.
new
(
noteable
,
project
,
author
,
body
,
action:
'published'
))
create_note
(
NoteSummary
.
new
(
noteable
,
project
,
author
,
body
,
action:
'published'
))
end
end
override
:track_cross_reference_action
def
track_cross_reference_action
super
counter
=
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
counter
.
track_epic_cross_referenced
(
author:
author
)
if
noteable
.
is_a?
(
Epic
)
end
end
end
end
end
end
end
ee/changelogs/unreleased/issue_292253-track_epic_cross_reference.yml
0 → 100644
View file @
4381c717
---
title
:
Track epic cross reference on usage ping
merge_request
:
59804
author
:
type
:
other
ee/config/metrics/counts_28d/20210430174100_g_project_management_epic_cross_referenced_monthly.yml
0 → 100644
View file @
4381c717
---
# 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_epic_cross_referenced_monthly
description
:
Count of MAU cross referencing epics
product_section
:
dev
product_stage
:
plan
product_group
:
group::product planning
product_category
:
epics_usage
value_type
:
number
status
:
implemented
milestone
:
"
13.12"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/59804
time_frame
:
28d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_7d/20210430173650_g_project_management_epic_cross_referenced_weekly.yml
0 → 100644
View file @
4381c717
---
# 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_epic_cross_referenced_weekly
description
:
Counts of WAU cross referencing epics
product_section
:
dev
product_stage
:
plan
product_group
:
group::product planning
product_category
:
epics_usage
value_type
:
number
status
:
implemented
milestone
:
"
13.12"
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/59804
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 @
4381c717
...
@@ -32,6 +32,7 @@ module Gitlab
...
@@ -32,6 +32,7 @@ module Gitlab
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_CHECKED
=
'project_management_users_checking_epic_task'
EPIC_TASK_UNCHECKED
=
'project_management_users_unchecking_epic_task'
EPIC_TASK_UNCHECKED
=
'project_management_users_unchecking_epic_task'
EPIC_CROSS_REFERENCED
=
'g_project_management_epic_cross_referenced'
class
<<
self
class
<<
self
def
track_epic_created_action
(
author
:)
def
track_epic_created_action
(
author
:)
...
@@ -134,6 +135,10 @@ module Gitlab
...
@@ -134,6 +135,10 @@ module Gitlab
track_unique_action
(
EPIC_TASK_UNCHECKED
,
author
)
track_unique_action
(
EPIC_TASK_UNCHECKED
,
author
)
end
end
def
track_epic_cross_referenced
(
author
:)
track_unique_action
(
EPIC_CROSS_REFERENCED
,
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 @
4381c717
...
@@ -303,4 +303,16 @@ RSpec.describe Gitlab::UsageDataCounters::EpicActivityUniqueCounter, :clean_gitl
...
@@ -303,4 +303,16 @@ 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 epic cross reference'
do
def
track_action
(
params
)
described_class
.
track_epic_cross_referenced
(
**
params
)
end
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_CROSS_REFERENCED
}
end
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
end
end
end
ee/spec/services/ee/system_notes/issuables_service_spec.rb
View file @
4381c717
...
@@ -60,4 +60,32 @@ RSpec.describe ::SystemNotes::IssuablesService do
...
@@ -60,4 +60,32 @@ RSpec.describe ::SystemNotes::IssuablesService do
expect
(
subject
.
note
).
to
eq
'published this issue to the status page'
expect
(
subject
.
note
).
to
eq
'published this issue to the status page'
end
end
end
end
describe
'#cross_reference'
do
let
(
:mentioner
)
{
create
(
:issue
,
project:
project
)
}
subject
{
service
.
cross_reference
(
mentioner
)
}
context
'when noteable is an epic'
do
let
(
:noteable
)
{
epic
}
it_behaves_like
'a system note'
,
exclude_project:
true
do
let
(
:action
)
{
'cross_reference'
}
end
it
'tracks epic cross reference event in usage ping'
do
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
to
receive
(
:track_epic_cross_referenced
).
with
(
author:
author
)
subject
end
end
context
'when notable is not an epic'
do
it
'does not tracks epic cross reference event in usage ping'
do
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
not_to
receive
(
:track_epic_cross_referenced
)
subject
end
end
end
end
end
lib/gitlab/usage_data_counters/known_events/epic_events.yml
View file @
4381c717
...
@@ -162,3 +162,9 @@
...
@@ -162,3 +162,9 @@
redis_slot
:
project_management
redis_slot
:
project_management
aggregation
:
daily
aggregation
:
daily
feature_flag
:
track_epics_activity
feature_flag
:
track_epics_activity
-
name
:
g_project_management_epic_cross_referenced
category
:
epics_usage
redis_slot
:
project_management
aggregation
:
daily
feature_flag
:
track_epics_activity
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