Skip to content
Snippets Groups Projects
Commit 59e80cac authored by Jarka Kadlecova's avatar Jarka Kadlecova
Browse files

Track making epics confidential/visible

- track 2 new events - epic becoming visible/confidential
- updatee the yml files and dictionary
- add specs
parent a33dd1ce
No related branches found
No related tags found
No related merge requests found
Showing
with 210 additions and 4 deletions
Loading
Loading
@@ -6368,6 +6368,18 @@ Status: `data_available`
 
Tiers: `premium`, `ultimate`
 
### `g_project_management_epic_confidential_monthly`
Count of MAU making epics confidential
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210310203049_g_product_planning_epic_confidential_monthly.yml)
Group: `group::product planning`
Status: `implemented`
Tiers: `premium`, `ultimate`
### `g_project_management_epic_created_monthly`
 
Count of MAU creating epics
Loading
Loading
@@ -6392,6 +6404,42 @@ Status: `implemented`
 
Tiers: `premium`, `ultimate`
 
### `g_project_management_epic_moveed_weekly`
Count of WAU making epics confidential
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210310203225_g_product_planning_epic_confidential_weekly.yml)
Group: `group::product planning`
Status: `implemented`
Tiers: `premium`, `ultimate`
### `g_project_management_epic_visible_monthly`
Count of MAU making epics visible
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210312093611_g_product_planning_epic_visible_monthly.yml)
Group: `group::product planning`
Status: `implemented`
Tiers: `premium`, `ultimate`
### `g_project_management_epic_visible_weekly`
Count of WAU making epics visible
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210312093243_g_product_planning_epic_visible_weekly.yml)
Group: `group::product planning`
Status: `implemented`
Tiers: `premium`, `ultimate`
### `geo_enabled`
 
Is Geo enabled?
Loading
Loading
Loading
Loading
@@ -38,9 +38,18 @@ def handle_changes(epic, options)
 
todo_service.update_epic(epic, current_user, old_mentioned_users)
 
if epic.previous_changes.include?('confidential') && epic.confidential?
if epic.previous_changes.include?('confidential')
handle_confidentiality_change(epic)
end
end
def handle_confidentiality_change(epic)
if epic.confidential?
::Gitlab::UsageDataCounters::EpicActivityUniqueCounter.track_epic_confidential_action(author: current_user)
# don't enqueue immediately to prevent todos removal in case of a mistake
::TodosDestroyer::ConfidentialEpicWorker.perform_in(::Todo::WAIT_FOR_DELETE, epic.id)
else
::Gitlab::UsageDataCounters::EpicActivityUniqueCounter.track_epic_visible_action(author: current_user)
end
end
 
Loading
Loading
---
title: Track epic confidentiality change action on usage ping
merge_request: 56483
author:
type: other
---
# 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: g_project_management_epic_confidential_monthly
description: Count of MAU making epics confidential
product_section: dev
product_stage: plan
product_group: group::product planning
product_category: epics_usage
value_type: number
status: implemented
milestone: "13.10"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56246
time_frame: 28d
data_source: redis_hll
distribution:
- ee
tier:
- premium
- ultimate
---
# 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: g_project_management_epic_visible_monthly
description: Count of MAU making epics visible
product_section: dev
product_stage: plan
product_group: group::product planning
product_category: epics_usage
value_type: number
status: implemented
milestone: "13.10"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56246
time_frame: 28d
data_source: redis_hll
distribution:
- ee
tier:
- premium
- ultimate
---
# 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: g_project_management_epic_confidential_weekly
description: Count of WAU making epics confidential
product_section: dev
product_stage: plan
product_group: group::product planning
product_category: epics_usage
value_type: number
status: implemented
milestone: "13.10"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56246
time_frame: 7d
data_source: redis_hll
distribution:
- ee
tier:
- premium
- ultimate
---
# 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: g_project_management_epic_visible_weekly
description: Count of WAU making epics visible
product_section: dev
product_stage: plan
product_group: group::product planning
product_category: epics_usage
value_type: number
status: implemented
milestone: "13.10"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56246
time_frame: 7d
data_source: redis_hll
distribution:
- ee
tier:
- premium
- ultimate
Loading
Loading
@@ -8,12 +8,22 @@ module EpicActivityUniqueCounter
# slot of issue events to allow data aggregation.
# More information in: https://gitlab.com/gitlab-org/gitlab/-/issues/322405
EPIC_CREATED = 'g_project_management_epic_created'
EPIC_CONFIDENTIAL = 'g_project_management_epic_confidential'
EPIC_VISIBLE = 'g_project_management_epic_visible'
 
class << self
def track_epic_created_action(author:, time: Time.zone.now)
track_unique_action(EPIC_CREATED, author, time)
end
 
def track_epic_confidential_action(author:, time: Time.zone.now)
track_unique_action(EPIC_CONFIDENTIAL, author, time)
end
def track_epic_visible_action(author:, time: Time.zone.now)
track_unique_action(EPIC_VISIBLE, author, time)
end
private
 
def track_unique_action(action, author, time)
Loading
Loading
Loading
Loading
@@ -19,4 +19,16 @@ def track_action(params)
 
it_behaves_like 'does not track when feature flag is disabled', :track_epics_activity
end
context 'for epic confidential event' do
def track_action(params)
described_class.track_epic_confidential_action(**params)
end
it_behaves_like 'a daily tracked issuable event' do
let(:action) { described_class::EPIC_CONFIDENTIAL }
end
it_behaves_like 'does not track when feature flag is disabled', :track_epics_activity
end
end
Loading
Loading
@@ -217,10 +217,38 @@ def update_epic(opts)
end
end
 
it 'schedules deletion of todos when epic becomes confidential' do
expect(TodosDestroyer::ConfidentialEpicWorker).to receive(:perform_in).with(Todo::WAIT_FOR_DELETE, epic.id)
context 'when the epic becomes confidential' do
it 'schedules deletion of todos' do
expect(TodosDestroyer::ConfidentialEpicWorker).to receive(:perform_in).with(Todo::WAIT_FOR_DELETE, epic.id)
 
update_epic(confidential: true)
update_epic(confidential: true)
end
it 'tracks the epic becoming confidential' do
expect(::Gitlab::UsageDataCounters::EpicActivityUniqueCounter)
.to receive(:track_epic_confidential_action).with(author: user)
update_epic(confidential: true)
end
end
context 'when the epic becomes visible' do
before do
epic.update_column(:confidential, true)
end
it 'does not schedule deletion of todos' do
expect(TodosDestroyer::ConfidentialEpicWorker).not_to receive(:perform_in)
update_epic(confidential: false)
end
it 'tracks the epic becoming visible' do
expect(::Gitlab::UsageDataCounters::EpicActivityUniqueCounter)
.to receive(:track_epic_visible_action).with(author: user)
update_epic(confidential: false)
end
end
end
 
Loading
Loading
Loading
Loading
@@ -454,3 +454,13 @@
redis_slot: project_management
aggregation: daily
feature_flag: track_epics_activity
- name: g_project_management_epic_confidential
category: epics_usage
redis_slot: project_management
aggregation: daily
feature_flag: track_epics_activity
- name: g_project_management_epic_visible
category: epics_usage
redis_slot: project_management
aggregation: daily
feature_flag: track_epics_activity
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment