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
d8957eb4
Commit
d8957eb4
authored
Apr 05, 2021
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track epic issues moved between projects
Record epic issues moved between projects with Redis HLL.
parent
ff6a7e96
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
118 additions
and
0 deletions
+118
-0
doc/development/usage_ping/dictionary.md
doc/development/usage_ping/dictionary.md
+24
-0
ee/app/services/ee/issues/move_service.rb
ee/app/services/ee/issues/move_service.rb
+7
-0
ee/changelogs/unreleased/issue_292253-epic_issue_moved.yml
ee/changelogs/unreleased/issue_292253-epic_issue_moved.yml
+5
-0
ee/config/metrics/counts_28d/20210405190240_g_project_management_epic_issue_moved_from_project_monthly.yml
...ject_management_epic_issue_moved_from_project_monthly.yml
+21
-0
ee/config/metrics/counts_7d/20210405185814_g_project_management_epic_issue_moved_from_project_weekly.yml
...oject_management_epic_issue_moved_from_project_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/issues/move_service_spec.rb
ee/spec/services/ee/issues/move_service_spec.rb
+17
-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.
doc/development/usage_ping/dictionary.md
View file @
d8957eb4
...
...
@@ -9896,6 +9896,30 @@ Status: `implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_epic_issue_moved_from_project_monthly`
Counts of MAU moving epic issues between projects
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210405190240_g_project_management_epic_issue_moved_from_project_monthly.yml
)
Group:
`group::product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_epic_issue_moved_from_project_weekly`
Counts of WAU moving epic issues between projects
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210405185814_g_project_management_epic_issue_moved_from_project_weekly.yml
)
Group:
`group::product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `redis_hll_counters.epics_usage.g_project_management_epic_issue_removed_monthly`
Count of MAU removing issues from epics
...
...
ee/app/services/ee/issues/move_service.rb
View file @
d8957eb4
...
...
@@ -9,6 +9,7 @@ module EE
def
update_old_entity
rewrite_epic_issue
rewrite_related_vulnerability_issues
track_epic_issue_moved_from_project
super
end
...
...
@@ -25,6 +26,12 @@ module EE
original_entity
.
reset
end
def
track_epic_issue_moved_from_project
return
unless
original_entity
.
epic_issue
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_issue_moved_from_project
(
author:
current_user
)
end
def
rewrite_related_vulnerability_issues
issue_links
=
Vulnerabilities
::
IssueLink
.
for_issue
(
original_entity
)
issue_links
.
update_all
(
issue_id:
new_entity
.
id
)
...
...
ee/changelogs/unreleased/issue_292253-epic_issue_moved.yml
0 → 100644
View file @
d8957eb4
---
title
:
Track epic issues moved between projects
merge_request
:
58590
author
:
type
:
other
ee/config/metrics/counts_28d/20210405190240_g_project_management_epic_issue_moved_from_project_monthly.yml
0 → 100644
View file @
d8957eb4
---
# 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_moved_from_project_monthly
description
:
Counts of MAU moving epic issues between projects
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/58590
time_frame
:
28d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_7d/20210405185814_g_project_management_epic_issue_moved_from_project_weekly.yml
0 → 100644
View file @
d8957eb4
---
# 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_moved_from_project_weekly
description
:
Counts of WAU moving epic issues between projects
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/58590
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 @
d8957eb4
...
...
@@ -21,6 +21,7 @@ module Gitlab
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_ISSUE_MOVED_FROM_PROJECT
=
'g_project_management_epic_issue_moved_from_project'
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'
...
...
@@ -85,6 +86,10 @@ module Gitlab
track_unique_action
(
EPIC_ISSUE_REMOVED
,
author
)
end
def
track_epic_issue_moved_from_project
(
author
:)
track_unique_action
(
EPIC_ISSUE_MOVED_FROM_PROJECT
,
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 @
d8957eb4
...
...
@@ -234,6 +234,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 moving an issue that belongs to epic'
do
def
track_action
(
params
)
described_class
.
track_epic_issue_moved_from_project
(
**
params
)
end
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_ISSUE_MOVED_FROM_PROJECT
}
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/ee/issues/move_service_spec.rb
View file @
d8957eb4
...
...
@@ -29,6 +29,23 @@ RSpec.describe Issues::MoveService do
expect
{
move_service
.
execute
(
old_issue
,
new_project
)
}
.
not_to
raise_error
# Sidekiq::Worker::EnqueueFromTransactionError
end
context
'when moved issue belongs to epic'
do
it
'records epic moved from project event'
do
create
(
:epic_issue
,
issue:
old_issue
)
expect
(
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
to
receive
(
:track_epic_issue_moved_from_project
).
with
(
author:
user
)
move_service
.
execute
(
old_issue
,
new_project
)
end
end
context
'when moved issue does not belong to epic'
do
it
'does not record epic moved from project event'
do
expect
(
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
not_to
receive
(
:track_epic_issue_moved_from_project
)
move_service
.
execute
(
old_issue
,
new_project
)
end
end
end
context
'resource weight events'
do
...
...
lib/gitlab/usage_data_counters/known_events/epic_events.yml
View file @
d8957eb4
...
...
@@ -93,6 +93,12 @@
aggregation
:
daily
feature_flag
:
track_epics_activity
-
name
:
g_project_management_epic_issue_moved_from_project
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