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
f2966343
Commit
f2966343
authored
Apr 23, 2021
by
charlie ablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track epic parent changes via usage ping
- add dictionary update - add tests Changelog: other
parent
24909597
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
118 additions
and
2 deletions
+118
-2
doc/development/usage_ping/dictionary.md
doc/development/usage_ping/dictionary.md
+24
-0
ee/app/services/epics/base_service.rb
ee/app/services/epics/base_service.rb
+18
-2
ee/changelogs/unreleased/292253-track-epic-set-parent.yml
ee/changelogs/unreleased/292253-track-epic-set-parent.yml
+5
-0
ee/config/metrics/counts_28d/20210423011841_g_project_management_users_updating_epic_parent_monthly.yml
...project_management_users_updating_epic_parent_monthly.yml
+21
-0
ee/config/metrics/counts_7d/20210423012053_g_project_management_users_updating_epic_parent_weekly.yml
..._project_management_users_updating_epic_parent_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/epics/update_service_spec.rb
ee/spec/services/epics/update_service_spec.rb
+4
-0
lib/gitlab/usage_data_counters/known_events/epic_events.yml
lib/gitlab/usage_data_counters/known_events/epic_events.yml
+8
-0
No files found.
doc/development/usage_ping/dictionary.md
View file @
f2966343
...
...
@@ -10280,6 +10280,30 @@ Status: `implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_updating_epic_parent_monthly`
Counts of MAU updating parent on epic
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210423011841_g_project_management_users_updating_epic_parent_monthly.yml
)
Group:
`group::product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_updating_epic_parent_weekly`
Counts of WAU updating parent on epic
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210423012053_g_project_management_users_updating_epic_parent_weekly.yml
)
Group:
`group::product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_updating_epic_titles_monthly`
Counts of MAU changing epic titles
...
...
ee/app/services/epics/base_service.rb
View file @
f2966343
...
...
@@ -29,13 +29,25 @@ module Epics
def
assign_parent_epic_for
(
epic
)
return
unless
parent_epic
EpicLinks
::
CreateService
.
new
(
parent_epic
,
current_user
,
{
target_issuable:
epic
}).
execute
result
=
EpicLinks
::
CreateService
.
new
(
parent_epic
,
current_user
,
{
target_issuable:
epic
}).
execute
unless
result
[
:status
]
==
:error
track_epic_parent_updated
end
result
end
def
assign_child_epic_for
(
epic
)
return
unless
child_epic
EpicLinks
::
CreateService
.
new
(
epic
,
current_user
,
{
target_issuable:
child_epic
}).
execute
result
=
EpicLinks
::
CreateService
.
new
(
epic
,
current_user
,
{
target_issuable:
child_epic
}).
execute
unless
result
[
:status
]
==
:error
track_epic_parent_updated
end
result
end
def
available_labels
...
...
@@ -58,5 +70,9 @@ module Epics
def
reopen_service
Epics
::
ReopenService
end
def
track_epic_parent_updated
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_parent_updated_action
(
author:
current_user
)
end
end
end
ee/changelogs/unreleased/292253-track-epic-set-parent.yml
0 → 100644
View file @
f2966343
---
title
:
Track epic parent changes via usage ping
merge_request
:
60079
author
:
type
:
other
ee/config/metrics/counts_28d/20210423011841_g_project_management_users_updating_epic_parent_monthly.yml
0 → 100644
View file @
f2966343
---
# 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_parent_monthly
description
:
Counts of MAU updating parent on epic
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/60079
time_frame
:
28d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_7d/20210423012053_g_project_management_users_updating_epic_parent_weekly.yml
0 → 100644
View file @
f2966343
---
# 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_parent_weekly
description
:
Counts of WAU updating parent on epic
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/60079
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 @
f2966343
...
...
@@ -22,6 +22,7 @@ module Gitlab
EPIC_ISSUE_ADDED
=
'g_project_management_epic_issue_added'
EPIC_ISSUE_REMOVED
=
'g_project_management_epic_issue_removed'
EPIC_ISSUE_MOVED_FROM_PROJECT
=
'g_project_management_epic_issue_moved_from_project'
EPIC_PARENT_UPDATED
=
'g_project_management_users_updating_epic_parent'
EPIC_CLOSED
=
'g_project_management_epic_closed'
EPIC_REOPENED
=
'g_project_management_epic_reopened'
ISSUE_PROMOTED_TO_EPIC
=
'g_project_management_issue_promoted_to_epic'
...
...
@@ -91,6 +92,10 @@ module Gitlab
track_unique_action
(
EPIC_ISSUE_MOVED_FROM_PROJECT
,
author
)
end
def
track_epic_parent_updated_action
(
author
:)
track_unique_action
(
EPIC_PARENT_UPDATED
,
author
)
end
def
track_epic_closed_action
(
author
:)
track_unique_action
(
EPIC_CLOSED
,
author
)
end
...
...
ee/spec/lib/gitlab/usage_data_counters/epic_activity_unique_counter_spec.rb
View file @
f2966343
...
...
@@ -246,6 +246,18 @@ RSpec.describe Gitlab::UsageDataCounters::EpicActivityUniqueCounter, :clean_gitl
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
end
context
'updating epic parent'
do
def
track_action
(
params
)
described_class
.
track_epic_parent_updated_action
(
**
params
)
end
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_PARENT_UPDATED
}
end
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
end
context
'for promoting issue to epic'
do
def
track_action
(
params
)
described_class
.
track_issue_promoted_to_epic
(
**
params
)
...
...
ee/spec/services/epics/update_service_spec.rb
View file @
f2966343
...
...
@@ -447,6 +447,7 @@ RSpec.describe Epics::UpdateService do
context
'for /parent_epic'
do
it
'assigns parent epic'
do
parent_epic
=
create
(
:epic
,
group:
epic
.
group
)
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
to
receive
(
:track_epic_parent_updated_action
)
update_epic
(
description:
"/parent_epic
#{
parent_epic
.
to_reference
}
"
)
...
...
@@ -457,6 +458,7 @@ RSpec.describe Epics::UpdateService do
it
'does not update parent epic'
do
other_group
=
create
(
:group
,
:private
)
parent_epic
=
create
(
:epic
,
group:
other_group
)
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
not_to
receive
(
:track_epic_parent_updated_action
)
update_epic
(
description:
"/parent_epic
#{
parent_epic
.
to_reference
(
group
)
}
"
)
...
...
@@ -468,6 +470,7 @@ RSpec.describe Epics::UpdateService do
context
'for /child_epic'
do
it
'sets a child epic'
do
child_epic
=
create
(
:epic
,
group:
group
)
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
to
receive
(
:track_epic_parent_updated_action
)
update_epic
(
description:
"/child_epic
#{
child_epic
.
to_reference
}
"
)
...
...
@@ -478,6 +481,7 @@ RSpec.describe Epics::UpdateService do
it
'does not set child epic'
do
other_group
=
create
(
:group
,
:private
)
child_epic
=
create
(
:epic
,
group:
other_group
)
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
not_to
receive
(
:track_epic_parent_updated_action
)
update_epic
(
description:
"/child_epic
#{
child_epic
.
to_reference
(
group
)
}
"
)
expect
(
epic
.
reload
.
children
).
to
be_empty
...
...
lib/gitlab/usage_data_counters/known_events/epic_events.yml
View file @
f2966343
...
...
@@ -81,6 +81,8 @@
aggregation
:
daily
feature_flag
:
track_epics_activity
# relationships
-
name
:
g_project_management_epic_issue_added
category
:
epics_usage
redis_slot
:
project_management
...
...
@@ -99,6 +101,12 @@
aggregation
:
daily
feature_flag
:
track_epics_activity
-
name
:
g_project_management_users_updating_epic_parent
category
:
epics_usage
redis_slot
:
project_management
aggregation
:
daily
feature_flag
:
track_epics_activity
-
name
:
g_project_management_epic_closed
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