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
ca786904
Commit
ca786904
authored
Feb 08, 2021
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track epics created
Add epics created to usaged ping using redis counter
parent
0f0fabbf
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
198 additions
and
35 deletions
+198
-35
doc/development/usage_ping/dictionary.md
doc/development/usage_ping/dictionary.md
+24
-0
ee/app/models/ee/epic.rb
ee/app/models/ee/epic.rb
+5
-0
ee/changelogs/unreleased/issue_292253-epic_created_counter.yml
...angelogs/unreleased/issue_292253-epic_created_counter.yml
+5
-0
ee/config/feature_flags/development/track_epics_activity.yml
ee/config/feature_flags/development/track_epics_activity.yml
+8
-0
ee/config/metrics/counts_28d/20210305144719_g_product_planning_epic_created_monthly.yml
...0210305144719_g_product_planning_epic_created_monthly.yml
+21
-0
ee/config/metrics/counts_7d/20210305145820_g_product_planning_epic_created_weekly.yml
...20210305145820_g_product_planning_epic_created_weekly.yml
+21
-0
ee/lib/gitlab/usage_data_counters/epic_activity_unique_counter.rb
...itlab/usage_data_counters/epic_activity_unique_counter.rb
+28
-0
ee/spec/lib/ee/gitlab/usage_data_counters/issue_activity_unique_counter_spec.rb
...usage_data_counters/issue_activity_unique_counter_spec.rb
+6
-6
ee/spec/lib/gitlab/usage_data_counters/epic_activity_unique_counter_spec.rb
.../usage_data_counters/epic_activity_unique_counter_spec.rb
+22
-0
ee/spec/models/epic_spec.rb
ee/spec/models/epic_spec.rb
+8
-0
lib/gitlab/usage_data_counters/known_events/common.yml
lib/gitlab/usage_data_counters/known_events/common.yml
+10
-0
spec/lib/gitlab/usage_data_counters/hll_redis_counter_spec.rb
.../lib/gitlab/usage_data_counters/hll_redis_counter_spec.rb
+2
-1
spec/lib/gitlab/usage_data_counters/issue_activity_unique_counter_spec.rb
...usage_data_counters/issue_activity_unique_counter_spec.rb
+26
-26
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+1
-1
spec/support/shared_examples/lib/gitlab/usage_data_counters/issuable_activity_shared_examples.rb
.../usage_data_counters/issuable_activity_shared_examples.rb
+11
-1
No files found.
doc/development/usage_ping/dictionary.md
View file @
ca786904
...
...
@@ -6368,6 +6368,30 @@ Status: `data_available`
Tiers:
`free`
### `g_project_management_epic_created_monthly`
Count of MAU creating epics
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210305144719_g_product_planning_epic_created_monthly.yml
)
Group:
`group::product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `g_project_management_epic_created_weekly`
Count of WAU creating epics
[
YAML definition
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210305145820_g_product_planning_epic_created_weekly.yml
)
Group:
`group::product planning`
Status:
`implemented`
Tiers:
`premium`
,
`ultimate`
### `geo_enabled`
Is Geo enabled?
...
...
ee/app/models/ee/epic.rb
View file @
ca786904
...
...
@@ -135,6 +135,7 @@ module EE
before_save
:set_fixed_start_date
,
if: :start_date_is_fixed?
before_save
:set_fixed_due_date
,
if: :due_date_is_fixed?
after_create_commit
:usage_ping_record_epic_creation
def
epic_tree_root?
parent_id
.
nil?
...
...
@@ -161,6 +162,10 @@ module EE
self
.
due_date_sourcing_milestone
=
nil
self
.
due_date_sourcing_epic
=
nil
end
def
usage_ping_record_epic_creation
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
.
track_epic_created_action
(
author:
author
)
end
end
class_methods
do
...
...
ee/changelogs/unreleased/issue_292253-epic_created_counter.yml
0 → 100644
View file @
ca786904
---
title
:
Track epic creation action on usage ping
merge_request
:
53651
author
:
type
:
other
ee/config/feature_flags/development/track_epics_activity.yml
0 → 100644
View file @
ca786904
---
name
:
track_epics_activity
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/53651
rollout_issue_url
:
milestone
:
'
13.10'
type
:
development
group
:
group::product planning
default_enabled
:
true
ee/config/metrics/counts_28d/20210305144719_g_product_planning_epic_created_monthly.yml
0 → 100644
View file @
ca786904
---
# 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_created_monthly
description
:
Count of MAU creating epics
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/53651
time_frame
:
28d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/config/metrics/counts_7d/20210305145820_g_product_planning_epic_created_weekly.yml
0 → 100644
View file @
ca786904
---
# 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_created_weekly
description
:
Count of WAU creating epics
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/53651
time_frame
:
7d
data_source
:
redis_hll
distribution
:
-
ee
tier
:
-
premium
-
ultimate
ee/lib/gitlab/usage_data_counters/epic_activity_unique_counter.rb
0 → 100644
View file @
ca786904
# frozen_string_literal: true
module
Gitlab
module
UsageDataCounters
module
EpicActivityUniqueCounter
# The 'g_project_management' prefix need to be present
# on epic event names, because they are persisted at the same
# 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'
class
<<
self
def
track_epic_created_action
(
author
:,
time:
Time
.
zone
.
now
)
track_unique_action
(
EPIC_CREATED
,
author
,
time
)
end
private
def
track_unique_action
(
action
,
author
,
time
)
return
unless
Feature
.
enabled?
(
:track_epics_activity
,
default_enabled:
true
)
return
unless
author
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
track_event
(
action
,
values:
author
.
id
,
time:
time
)
end
end
end
end
end
ee/spec/lib/ee/gitlab/usage_data_counters/issue_activity_unique_counter_spec.rb
View file @
ca786904
...
...
@@ -9,7 +9,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
let
(
:time
)
{
Time
.
zone
.
now
}
context
'for Issue health status changed actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_HEALTH_STATUS_CHANGED
}
def
track_action
(
params
)
...
...
@@ -19,7 +19,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue iteration changed actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_ITERATION_CHANGED
}
def
track_action
(
params
)
...
...
@@ -29,7 +29,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue weight changed actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_WEIGHT_CHANGED
}
def
track_action
(
params
)
...
...
@@ -39,7 +39,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue added to epic actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_ADDED_TO_EPIC
}
def
track_action
(
params
)
...
...
@@ -49,7 +49,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue removed from epic actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_REMOVED_FROM_EPIC
}
def
track_action
(
params
)
...
...
@@ -59,7 +59,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue changed epic actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_CHANGED_EPIC
}
def
track_action
(
params
)
...
...
ee/spec/lib/gitlab/usage_data_counters/epic_activity_unique_counter_spec.rb
0 → 100644
View file @
ca786904
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
,
:clean_gitlab_redis_shared_state
do
let
(
:user1
)
{
build
(
:user
,
id:
1
)
}
let
(
:user2
)
{
build
(
:user
,
id:
2
)
}
let
(
:user3
)
{
build
(
:user
,
id:
3
)
}
let
(
:time
)
{
Time
.
zone
.
now
}
context
'for epic created event'
do
def
track_action
(
params
)
described_class
.
track_epic_created_action
(
**
params
)
end
it_behaves_like
'a daily tracked issuable event'
do
let
(
:action
)
{
described_class
::
EPIC_CREATED
}
end
it_behaves_like
'does not track when feature flag is disabled'
,
:track_epics_activity
end
end
ee/spec/models/epic_spec.rb
View file @
ca786904
...
...
@@ -725,4 +725,12 @@ RSpec.describe Epic do
end
it_behaves_like
'versioned description'
describe
'#usage_ping_record_epic_creation'
do
it
'records epic creation after saving'
do
expect
(
::
Gitlab
::
UsageDataCounters
::
EpicActivityUniqueCounter
).
to
receive
(
:track_epic_created_action
)
create
(
:epic
)
end
end
end
lib/gitlab/usage_data_counters/known_events/common.yml
View file @
ca786904
...
...
@@ -445,3 +445,13 @@
redis_slot
:
pipeline_authoring
aggregation
:
weekly
feature_flag
:
usage_data_o_pipeline_authoring_unique_users_pushing_mr_ciconfigfile
# Epic events
#
# We are using the same slot of issue events 'project_management' for
# epic events to allow data aggregation.
# More information in: https://gitlab.com/gitlab-org/gitlab/-/issues/322405
-
name
:
g_project_management_epic_created
category
:
epics_usage
redis_slot
:
project_management
aggregation
:
daily
feature_flag
:
track_epics_activity
spec/lib/gitlab/usage_data_counters/hll_redis_counter_spec.rb
View file @
ca786904
...
...
@@ -42,7 +42,8 @@ RSpec.describe Gitlab::UsageDataCounters::HLLRedisCounter, :clean_gitlab_redis_s
'terraform'
,
'ci_templates'
,
'quickactions'
,
'pipeline_authoring'
'pipeline_authoring'
,
'epics_usage'
)
end
end
...
...
spec/lib/gitlab/usage_data_counters/issue_activity_unique_counter_spec.rb
View file @
ca786904
...
...
@@ -9,7 +9,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
let
(
:time
)
{
Time
.
zone
.
now
}
context
'for Issue title edit actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_TITLE_CHANGED
}
def
track_action
(
params
)
...
...
@@ -19,7 +19,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue description edit actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_DESCRIPTION_CHANGED
}
def
track_action
(
params
)
...
...
@@ -29,7 +29,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue assignee edit actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_ASSIGNEE_CHANGED
}
def
track_action
(
params
)
...
...
@@ -39,7 +39,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue make confidential actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_MADE_CONFIDENTIAL
}
def
track_action
(
params
)
...
...
@@ -49,7 +49,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue make visible actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_MADE_VISIBLE
}
def
track_action
(
params
)
...
...
@@ -59,7 +59,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue created actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_CREATED
}
def
track_action
(
params
)
...
...
@@ -69,7 +69,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue closed actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_CLOSED
}
def
track_action
(
params
)
...
...
@@ -79,7 +79,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue reopened actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_REOPENED
}
def
track_action
(
params
)
...
...
@@ -89,7 +89,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue label changed actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_LABEL_CHANGED
}
def
track_action
(
params
)
...
...
@@ -99,7 +99,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue cross-referenced actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_CROSS_REFERENCED
}
def
track_action
(
params
)
...
...
@@ -109,7 +109,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue moved actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_MOVED
}
def
track_action
(
params
)
...
...
@@ -119,7 +119,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue cloned actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_CLONED
}
def
track_action
(
params
)
...
...
@@ -129,7 +129,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue relate actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_RELATED
}
def
track_action
(
params
)
...
...
@@ -139,7 +139,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue unrelate actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_UNRELATED
}
def
track_action
(
params
)
...
...
@@ -149,7 +149,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue marked as duplicate actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_MARKED_AS_DUPLICATE
}
def
track_action
(
params
)
...
...
@@ -159,7 +159,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue locked actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_LOCKED
}
def
track_action
(
params
)
...
...
@@ -169,7 +169,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue unlocked actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_UNLOCKED
}
def
track_action
(
params
)
...
...
@@ -179,7 +179,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue designs added actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_DESIGNS_ADDED
}
def
track_action
(
params
)
...
...
@@ -189,7 +189,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue designs modified actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_DESIGNS_MODIFIED
}
def
track_action
(
params
)
...
...
@@ -199,7 +199,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue designs removed actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_DESIGNS_REMOVED
}
def
track_action
(
params
)
...
...
@@ -209,7 +209,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue due date changed actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_DUE_DATE_CHANGED
}
def
track_action
(
params
)
...
...
@@ -219,7 +219,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue time estimate changed actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_TIME_ESTIMATE_CHANGED
}
def
track_action
(
params
)
...
...
@@ -229,7 +229,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue time spent changed actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_TIME_SPENT_CHANGED
}
def
track_action
(
params
)
...
...
@@ -239,7 +239,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue comment added actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_COMMENT_ADDED
}
def
track_action
(
params
)
...
...
@@ -249,7 +249,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue comment edited actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_COMMENT_EDITED
}
def
track_action
(
params
)
...
...
@@ -259,7 +259,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context
'for Issue comment removed actions'
do
it_behaves_like
'a
tracked issue edit
event'
do
it_behaves_like
'a
daily tracked issuable
event'
do
let
(
:action
)
{
described_class
::
ISSUE_COMMENT_REMOVED
}
def
track_action
(
params
)
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
ca786904
...
...
@@ -1353,7 +1353,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
let
(
:categories
)
{
::
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
categories
}
let
(
:ineligible_total_categories
)
do
%w[source_code ci_secrets_management incident_management_alerts snippets terraform]
%w[source_code ci_secrets_management incident_management_alerts snippets terraform
epics_usage
]
end
it
'has all known_events'
do
...
...
spec/support/shared_examples/lib/gitlab/usage_data_counters/issue_activity_shared_examples.rb
→
spec/support/shared_examples/lib/gitlab/usage_data_counters/issu
abl
e_activity_shared_examples.rb
View file @
ca786904
# frozen_string_literal: true
RSpec
.
shared_examples
'a
tracked issue edit event'
do
|
event
|
RSpec
.
shared_examples
'a
daily tracked issuable event'
do
before
do
stub_application_setting
(
usage_ping_enabled:
true
)
end
...
...
@@ -25,3 +25,13 @@ RSpec.shared_examples 'a tracked issue edit event' do |event|
expect
(
track_action
(
author:
nil
)).
to
be_nil
end
end
RSpec
.
shared_examples
'does not track when feature flag is disabled'
do
|
feature_flag
|
context
"when feature flag
#{
feature_flag
}
is disabled"
do
it
'does not track action'
do
stub_feature_flags
(
feature_flag
=>
false
)
expect
(
track_action
(
author:
user1
)).
to
be_nil
end
end
end
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