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
7a10b532
Commit
7a10b532
authored
Apr 01, 2021
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track issues removed from epics on usage ping
Track issues removed from epics on usage ping using Redis HLL.
parent
67e9e9ab
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
127 additions
and
7 deletions
+127
-7
app/services/issuable_links/destroy_service.rb
app/services/issuable_links/destroy_service.rb
+6
-2
doc/development/usage_ping/dictionary.md
doc/development/usage_ping/dictionary.md
+24
-0
ee/app/services/epic_issues/destroy_service.rb
ee/app/services/epic_issues/destroy_service.rb
+12
-5
ee/changelogs/unreleased/issue_292253-issue_removed_from_epic.yml
...elogs/unreleased/issue_292253-issue_removed_from_epic.yml
+5
-0
ee/config/metrics/counts_28d/20210401183230_g_project_management_epic_issue_removed_monthly.yml
...83230_g_project_management_epic_issue_removed_monthly.yml
+21
-0
ee/config/metrics/counts_7d/20210401182457_g_project_management_g_project_management_epic_issue_removed_weekly.yml
...gement_g_project_management_epic_issue_removed_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/epic_issues/destroy_service_spec.rb
ee/spec/services/epic_issues/destroy_service_spec.rb
+15
-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/issuable_links/destroy_service.rb
View file @
7a10b532
...
...
@@ -15,14 +15,18 @@ module IssuableLinks
return
error
(
not_found_message
,
404
)
unless
permission_to_remove_relation?
remove_relation
create_notes
track_event
after_destroy
success
(
message:
'Relation was removed'
)
end
private
def
after_destroy
create_notes
track_event
end
def
remove_relation
link
.
destroy!
end
...
...
doc/development/usage_ping/dictionary.md
View file @
7a10b532
...
...
@@ -9908,6 +9908,30 @@ Status: `implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_epic_issue_removed_monthly`
Count of MAU removing issues from epics
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210401183230_g_project_management_epic_issue_removed_monthly.yml
)
Group:
`group::product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_epic_issue_removed_weekly`
Counts of WAU removing issues from epics
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210401182457_g_project_management_g_project_management_epic_issue_removed_weekly.yml
)
Group:
`group::product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_epic_reopened_monthly`
Counts of MAU closing epics
...
...
ee/app/services/epic_issues/destroy_service.rb
View file @
7a10b532
...
...
@@ -2,14 +2,21 @@
module
EpicIssues
class
DestroyService
<
IssuableLinks
::
DestroyService
def
execute
result
=
super
Epics
::
UpdateDatesService
.
new
([
link
.
epic
]).
execute
extend
::
Gitlab
::
Utils
::
Override
private
override
:after_destroy
def
after_destroy
super
result
Epics
::
UpdateDatesService
.
new
([
link
.
epic
]).
execute
track_usage_ping_event
end
private
def
track_usage_ping_event
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_issue_removed
(
author:
current_user
)
end
def
source
@source
||=
link
.
epic
...
...
ee/changelogs/unreleased/issue_292253-issue_removed_from_epic.yml
0 → 100644
View file @
7a10b532
---
title
:
Track issue removed from epic on usage ping
merge_request
:
58426
author
:
type
:
other
ee/config/metrics/counts_28d/20210401183230_g_project_management_epic_issue_removed_monthly.yml
0 → 100644
View file @
7a10b532
---
# 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_issue_removed_monthly
description
:
Count of MAU removing issues from epics
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/58426
time_frame
:
28d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_7d/20210401182457_g_project_management_g_project_management_epic_issue_removed_weekly.yml
0 → 100644
View file @
7a10b532
---
# 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_issue_removed_weekly
description
:
Counts of WAU removing issues from epics
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/58426
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 @
7a10b532
...
...
@@ -20,6 +20,7 @@ module Gitlab
EPIC_FIXED_START_DATE_UPDATED
=
'g_project_management_users_updating_fixed_epic_start_date'
EPIC_FIXED_DUE_DATE_UPDATED
=
'g_project_management_users_updating_fixed_epic_due_date'
EPIC_ISSUE_ADDED
=
'g_project_management_epic_issue_added'
EPIC_ISSUE_REMOVED
=
'g_project_management_epic_issue_removed'
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'
...
...
@@ -77,6 +78,10 @@ module Gitlab
track_unique_action
(
EPIC_ISSUE_ADDED
,
author
)
end
def
track_epic_issue_removed
(
author
:)
track_unique_action
(
EPIC_ISSUE_REMOVED
,
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 @
7a10b532
...
...
@@ -188,6 +188,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 removing issue from epic event'
do
def
track_action
(
params
)
described_class
.
track_epic_issue_removed
(
**
params
)
end
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_ISSUE_REMOVED
}
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/epic_issues/destroy_service_spec.rb
View file @
7a10b532
...
...
@@ -66,6 +66,13 @@ RSpec.describe EpicIssues::DestroyService do
expect
(
note
.
noteable_type
).
to
eq
(
'Issue'
)
expect
(
note
.
system_note_metadata
.
action
).
to
eq
(
'issue_removed_from_epic'
)
end
it
'counts an usage ping event'
do
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
to
receive
(
:track_epic_issue_removed
)
.
with
(
author:
user
)
subject
end
end
context
'user does not have permissions to remove associations'
do
...
...
@@ -76,10 +83,18 @@ RSpec.describe EpicIssues::DestroyService do
it
'returns error message'
do
is_expected
.
to
eq
(
message:
'No Issue Link found'
,
status: :error
,
http_status:
404
)
end
it
'does not counts an usage ping event'
do
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
not_to
receive
(
:track_epic_issue_removed
)
subject
end
end
context
'refresh epic dates'
do
it
'calls UpdateDatesService'
do
group
.
add_reporter
(
user
)
expect
(
Epics
::
UpdateDatesService
).
to
receive
(
:new
).
with
([
epic_issue
.
epic
]).
and_call_original
subject
...
...
lib/gitlab/usage_data_counters/known_events/epic_events.yml
View file @
7a10b532
...
...
@@ -87,6 +87,12 @@
aggregation
:
daily
feature_flag
:
track_epics_activity
-
name
:
g_project_management_epic_issue_removed
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