Commit 841b162d authored by charlie ablett's avatar charlie ablett

Merge branch '292253-cablett-epic-remove-emoji' into 'master'

Track users removing epic emoji

See merge request gitlab-org/gitlab!60989
parents 7d24854f daefb82e
......@@ -4692,7 +4692,7 @@ Tiers: `free`, `premium`, `ultimate`
Projects with repository mirroring enabled
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216181920_projects_mirrored_with_pipelines_enabled.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_all/20210216181920_projects_mirrored_with_pipelines_enabled.yml)
Group: `group::continuous integration`
......@@ -10532,6 +10532,30 @@ Status: `implemented`
Tiers: `premium`, `ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_removing_epic_emoji_monthly`
Counts of MAU removing emoji on epic
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210505071850_g_project_management_users_removing_epic_emoji_monthly.yml)
Group: `group::product planning`
Status: `implemented`
Tiers: `premium`, `ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_removing_epic_emoji_weekly`
Counts of WAU removing emoji on epic
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210505071932_g_project_management_users_removing_epic_emoji_weekly.yml)
Group: `group::product planning`
Status: `implemented`
Tiers: `premium`, `ultimate`
### `redis_hll_counters.epics_usage.g_project_management_users_setting_epic_confidential_monthly`
Count of MAU making epics confidential
......@@ -16360,7 +16384,7 @@ Tiers: `free`
Count creator_id from projects with repository mirroring enabled.
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216181934_projects_mirrored_with_pipelines_enabled.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_all/20210216181934_projects_mirrored_with_pipelines_enabled.yml)
Group: `group::continuous integration`
......@@ -18280,7 +18304,7 @@ Tiers: `free`
Count creator_id from projects with repository mirroring enabled.
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210216181943_projects_mirrored_with_pipelines_enabled.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210216181943_projects_mirrored_with_pipelines_enabled.yml)
Group: `group::continuous integration`
......
......@@ -12,6 +12,11 @@ module EE
super
::Gitlab::StatusPage.trigger_publish(project, current_user, award)
track_epic_emoji_removed if awardable.is_a?(Epic)
end
def track_epic_emoji_removed
::Gitlab::UsageDataCounters::EpicActivityUniqueCounter.track_epic_emoji_removed_action(author: current_user)
end
end
end
......
---
title: Track users removing epic emoji via usage ping
merge_request: 60989
author:
type: other
---
key_path: redis_hll_counters.epics_usage.g_project_management_users_removing_epic_emoji_monthly
description: Counts of MAU removing emoji 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/60989
time_frame: 28d
data_source: redis_hll
distribution:
- ee
tier:
- premium
- ultimate
---
key_path: redis_hll_counters.epics_usage.g_project_management_users_removing_epic_emoji_weekly
description: Counts of WAU removing emoji 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/60989
time_frame: 28d
data_source: redis_hll
distribution:
- ee
tier:
- premium
- ultimate
......@@ -14,6 +14,7 @@ module Gitlab
EPIC_NOTE_UPDATED = 'g_project_management_users_updating_epic_notes'
EPIC_NOTE_DESTROYED = 'g_project_management_users_destroying_epic_notes'
EPIC_EMOJI_AWARDED = 'g_project_management_users_awarding_epic_emoji'
EPIC_EMOJI_REMOVED = 'g_project_management_users_removing_epic_emoji'
EPIC_START_DATE_SET_AS_FIXED = 'g_project_management_users_setting_epic_start_date_as_fixed'
EPIC_START_DATE_SET_AS_INHERITED = 'g_project_management_users_setting_epic_start_date_as_inherited'
EPIC_DUE_DATE_SET_AS_FIXED = 'g_project_management_users_setting_epic_due_date_as_fixed'
......@@ -63,6 +64,10 @@ module Gitlab
track_unique_action(EPIC_EMOJI_AWARDED, author)
end
def track_epic_emoji_removed_action(author:)
track_unique_action(EPIC_EMOJI_REMOVED, author)
end
def track_epic_start_date_set_as_fixed_action(author:)
track_unique_action(EPIC_START_DATE_SET_AS_FIXED, author)
end
......
......@@ -84,6 +84,16 @@ RSpec.describe Gitlab::UsageDataCounters::EpicActivityUniqueCounter, :clean_gitl
end
end
context 'for epic emoji remove event' do
def track_action(params)
described_class.track_epic_emoji_removed_action(**params)
end
it_behaves_like 'a daily tracked issuable event' do
let(:action) { described_class::EPIC_EMOJI_REMOVED }
end
end
context 'for epic closing event' do
def track_action(params)
described_class.track_epic_closed_action(**params)
......
......@@ -4,22 +4,24 @@ require 'spec_helper'
RSpec.describe AwardEmojis::DestroyService do
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project) }
let_it_be(:group) { create(:group, :public) }
let_it_be(:project) { create(:project, group: group) }
let_it_be(:awardable) { create(:note_on_issue, project: project) }
let(:name) { 'thumbsup' }
subject(:service) { described_class.new(awardable, name, user) }
let(:service) { described_class.new(awardable, name, user) }
describe '#execute' do
describe 'publish to status page' do
let(:execute) { service.execute }
let(:issue_id) { awardable.noteable_id }
subject(:execute) { service.execute }
before do
create(:award_emoji, user: user, name: name, awardable: awardable)
end
describe 'publish to status page' do
let(:issue_id) { awardable.noteable_id }
context 'with recognized emoji' do
let(:name) { Gitlab::StatusPage::AWARD_EMOJI }
......@@ -32,5 +34,30 @@ RSpec.describe AwardEmojis::DestroyService do
include_examples 'no trigger status page publish'
end
end
describe 'tracking emoji removing' do
context 'when awardable is an epic' do
let_it_be(:awardable) { create(:epic, group: group) }
before do
stub_licensed_features(epics: true)
group.add_developer(user)
end
it 'tracks usage' do
expect(::Gitlab::UsageDataCounters::EpicActivityUniqueCounter).to receive(:track_epic_emoji_removed_action)
execute
end
end
context 'when awardable is not an epic' do
it 'does not track epic emoji awarding' do
expect(::Gitlab::UsageDataCounters::EpicActivityUniqueCounter).not_to receive(:track_epic_emoji_removed_action)
execute
end
end
end
end
end
......@@ -63,6 +63,12 @@
aggregation: daily
feature_flag: track_epics_activity
- name: g_project_management_users_removing_epic_emoji
category: epics_usage
redis_slot: project_management
aggregation: daily
feature_flag: track_epics_activity
# start date events
- name: g_project_management_users_setting_epic_start_date_as_fixed
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment