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
edaf424a
Commit
edaf424a
authored
Apr 07, 2021
by
Jarka Košanová
Committed by
Luke Duncalfe
Apr 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track epic labels change action on usage ping
https://gitlab.com/gitlab-org/gitlab/-/issues/292253
parent
26dcd829
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
163 additions
and
2 deletions
+163
-2
doc/development/usage_ping/dictionary.md
doc/development/usage_ping/dictionary.md
+24
-0
ee/app/services/ee/resource_events/change_labels_service.rb
ee/app/services/ee/resource_events/change_labels_service.rb
+7
-0
ee/changelogs/unreleased/292253-counts-epic-labels.yml
ee/changelogs/unreleased/292253-counts-epic-labels.yml
+5
-0
ee/config/metrics/counts_28d/20210312195730_g_project_management_epic_labels_monthly.yml
...210312195730_g_project_management_epic_labels_monthly.yml
+21
-0
ee/config/metrics/counts_7d/20210312195849_g_project_management_epic_labels_weekly.yml
...0210312195849_g_project_management_epic_labels_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
+10
-0
ee/spec/services/ee/resource_events/change_labels_service_spec.rb
...services/ee/resource_events/change_labels_service_spec.rb
+51
-0
ee/spec/services/epics/update_service_spec.rb
ee/spec/services/epics/update_service_spec.rb
+13
-2
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 @
edaf424a
...
@@ -9956,6 +9956,30 @@ Status: `implemented`
...
@@ -9956,6 +9956,30 @@ Status: `implemented`
Tiers:
`premium`
,
`ultimate`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_epic_users_changing_labels_monthly`
Count of MAU chaging the epic lables
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210312195730_g_project_management_epic_labels_monthly.yml
)
Group:
`group::product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_epic_users_changing_labels_weekly`
Count of WAU chaging the epic lables
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210312195849_g_project_management_epic_labels_weekly.yml
)
Group:
`group::product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_issue_promoted_to_epic_monthly`
### `redis_hll_counters.epics_usage.g_project_management_issue_promoted_to_epic_monthly`
Count of MAU promoting issues to epics
Count of MAU promoting issues to epics
...
...
ee/app/services/ee/resource_events/change_labels_service.rb
View file @
edaf424a
...
@@ -6,6 +6,13 @@ module EE
...
@@ -6,6 +6,13 @@ module EE
extend
ActiveSupport
::
Concern
extend
ActiveSupport
::
Concern
extend
::
Gitlab
::
Utils
::
Override
extend
::
Gitlab
::
Utils
::
Override
override
:execute
def
execute
(
added_labels:
[],
removed_labels:
[])
super
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_labels_changed_action
(
author:
user
)
if
resource
.
is_a?
(
Epic
)
end
override
:resource_column
override
:resource_column
def
resource_column
(
resource
)
def
resource_column
(
resource
)
resource
.
is_a?
(
Epic
)
?
:epic_id
:
super
resource
.
is_a?
(
Epic
)
?
:epic_id
:
super
...
...
ee/changelogs/unreleased/292253-counts-epic-labels.yml
0 → 100644
View file @
edaf424a
---
title
:
Track epic labels change action on usage ping
merge_request
:
56571
author
:
type
:
other
ee/config/metrics/counts_28d/20210312195730_g_project_management_epic_labels_monthly.yml
0 → 100644
View file @
edaf424a
---
# 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_users_changing_labels_monthly
description
:
Count of MAU chaging the epic lables
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/56571
time_frame
:
28d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_7d/20210312195849_g_project_management_epic_labels_weekly.yml
0 → 100644
View file @
edaf424a
---
# 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_users_changing_labels_weekly
description
:
Count of WAU chaging the epic lables
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/56571
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 @
edaf424a
...
@@ -26,6 +26,7 @@ module Gitlab
...
@@ -26,6 +26,7 @@ module Gitlab
ISSUE_PROMOTED_TO_EPIC
=
'g_project_management_issue_promoted_to_epic'
ISSUE_PROMOTED_TO_EPIC
=
'g_project_management_issue_promoted_to_epic'
EPIC_CONFIDENTIAL
=
'g_project_management_users_setting_epic_confidential'
EPIC_CONFIDENTIAL
=
'g_project_management_users_setting_epic_confidential'
EPIC_VISIBLE
=
'g_project_management_users_setting_epic_visible'
EPIC_VISIBLE
=
'g_project_management_users_setting_epic_visible'
EPIC_LABELS
=
'g_project_management_epic_users_changing_labels'
class
<<
self
class
<<
self
def
track_epic_created_action
(
author
:)
def
track_epic_created_action
(
author
:)
...
@@ -104,6 +105,10 @@ module Gitlab
...
@@ -104,6 +105,10 @@ module Gitlab
track_unique_action
(
EPIC_VISIBLE
,
author
)
track_unique_action
(
EPIC_VISIBLE
,
author
)
end
end
def
track_epic_labels_changed_action
(
author
:)
track_unique_action
(
EPIC_LABELS
,
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 @
edaf424a
...
@@ -208,6 +208,16 @@ RSpec.describe Gitlab::UsageDataCounters::EpicActivityUniqueCounter, :clean_gitl
...
@@ -208,6 +208,16 @@ RSpec.describe Gitlab::UsageDataCounters::EpicActivityUniqueCounter, :clean_gitl
it_behaves_like
'a daily tracked issuable event'
do
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_ISSUE_ADDED
}
let
(
:action
)
{
described_class
::
EPIC_ISSUE_ADDED
}
end
end
end
context
'for changing labels epic event'
do
def
track_action
(
params
)
described_class
.
track_epic_labels_changed_action
(
**
params
)
end
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_LABELS
}
end
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
...
...
ee/spec/services/ee/resource_events/change_labels_service_spec.rb
0 → 100644
View file @
edaf424a
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
ResourceEvents
::
ChangeLabelsService
do
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:labels
)
{
create_list
(
:group_label
,
2
,
group:
group
)
}
let
(
:resource
)
{
create
(
:epic
,
group:
group
)
}
describe
'.execute'
do
subject
{
described_class
.
new
(
resource
,
user
).
execute
(
added_labels:
added
,
removed_labels:
removed
)
}
context
'when adding a label'
do
let
(
:added
)
{
[
labels
[
0
]]
}
let
(
:removed
)
{
[]
}
it
'tracks the label change'
do
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
)
.
to
receive
(
:track_epic_labels_changed_action
).
with
(
author:
user
)
subject
end
end
context
'when removing a label'
do
let
(
:added
)
{
[]
}
let
(
:removed
)
{
[
labels
[
1
]]
}
it
'tracks the label change'
do
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
)
.
to
receive
(
:track_epic_labels_changed_action
).
with
(
author:
user
)
subject
end
end
context
'when both adding and removing labels'
do
let
(
:added
)
{
[
labels
[
0
]]
}
let
(
:removed
)
{
[
labels
[
1
]]
}
it
'tracks the label change'
do
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
)
.
to
receive
(
:track_epic_labels_changed_action
).
with
(
author:
user
)
subject
end
end
end
end
ee/spec/services/epics/update_service_spec.rb
View file @
edaf424a
...
@@ -220,19 +220,30 @@ RSpec.describe Epics::UpdateService do
...
@@ -220,19 +220,30 @@ RSpec.describe Epics::UpdateService do
user:
user2
)
user:
user2
)
end
end
subject
{
update_epic
(
label_ids:
[
label
.
id
])
}
before
do
before
do
group
.
add_developer
(
user
)
group
.
add_developer
(
user
)
update_epic
(
label_ids:
[
label
.
id
])
end
end
it
'marks todo as done for a user who added a label'
do
it
'marks todo as done for a user who added a label'
do
subject
expect
(
todo1
.
reload
.
state
).
to
eq
(
'done'
)
expect
(
todo1
.
reload
.
state
).
to
eq
(
'done'
)
end
end
it
'does not mark todos as done for other users'
do
it
'does not mark todos as done for other users'
do
subject
expect
(
todo2
.
reload
.
state
).
to
eq
(
'pending'
)
expect
(
todo2
.
reload
.
state
).
to
eq
(
'pending'
)
end
end
it
'tracks the label change'
do
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
)
.
to
receive
(
:track_epic_labels_changed_action
).
with
(
author:
user
)
subject
end
end
end
context
'mentioning a group in epic description'
do
context
'mentioning a group in epic description'
do
...
...
lib/gitlab/usage_data_counters/known_events/epic_events.yml
View file @
edaf424a
...
@@ -122,3 +122,9 @@
...
@@ -122,3 +122,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_users_changing_labels
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