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
ac29d813
Commit
ac29d813
authored
Feb 09, 2021
by
Kerri Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add approval rule create/update/delete events
Adds approval rule CUD tracking events.
parent
a933750e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
78 additions
and
0 deletions
+78
-0
config/feature_flags/development/usage_data_i_code_review_user_approval_rule_added.yml
...ent/usage_data_i_code_review_user_approval_rule_added.yml
+8
-0
config/feature_flags/development/usage_data_i_code_review_user_approval_rule_deleted.yml
...t/usage_data_i_code_review_user_approval_rule_deleted.yml
+8
-0
config/feature_flags/development/usage_data_i_code_review_user_approval_rule_edited.yml
...nt/usage_data_i_code_review_user_approval_rule_edited.yml
+8
-0
lib/gitlab/usage_data_counters/known_events/code_review_events.yml
...b/usage_data_counters/known_events/code_review_events.yml
+15
-0
lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb
...ge_data_counters/merge_request_activity_unique_counter.rb
+15
-0
spec/lib/gitlab/usage_data_counters/merge_request_activity_unique_counter_spec.rb
...ta_counters/merge_request_activity_unique_counter_spec.rb
+24
-0
No files found.
config/feature_flags/development/usage_data_i_code_review_user_approval_rule_added.yml
0 → 100644
View file @
ac29d813
---
name
:
usage_data_i_code_review_user_approval_rule_added
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/320966
rollout_issue_url
:
milestone
:
'
13.9'
type
:
development
group
:
group::code review
default_enabled
:
true
config/feature_flags/development/usage_data_i_code_review_user_approval_rule_deleted.yml
0 → 100644
View file @
ac29d813
---
name
:
usage_data_i_code_review_user_approval_rule_deleted
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/320966
rollout_issue_url
:
milestone
:
'
13.9'
type
:
development
group
:
group::code review
default_enabled
:
true
config/feature_flags/development/usage_data_i_code_review_user_approval_rule_edited.yml
0 → 100644
View file @
ac29d813
---
name
:
usage_data_i_code_review_user_approval_rule_edited
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/320966
rollout_issue_url
:
milestone
:
'
13.9'
type
:
development
group
:
group::code review
default_enabled
:
true
lib/gitlab/usage_data_counters/known_events/code_review_events.yml
View file @
ac29d813
...
...
@@ -124,3 +124,18 @@
category
:
code_review
aggregation
:
weekly
feature_flag
:
usage_data_i_code_review_user_review_requested
-
name
:
i_code_review_user_approval_rule_added
redis_slot
:
code_review
category
:
code_review
aggregation
:
weekly
feature_flag
:
usage_data_i_code_review_user_approval_rule_added
-
name
:
i_code_review_user_approval_rule_deleted
redis_slot
:
code_review
category
:
code_review
aggregation
:
weekly
feature_flag
:
usage_data_i_code_review_user_approval_rule_deleted
-
name
:
i_code_review_user_approval_rule_edited
redis_slot
:
code_review
category
:
code_review
aggregation
:
weekly
feature_flag
:
usage_data_i_code_review_user_approval_rule_edited
lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb
View file @
ac29d813
...
...
@@ -26,6 +26,9 @@ module Gitlab
MR_UNRESOLVE_THREAD_ACTION
=
'i_code_review_user_unresolve_thread'
MR_ASSIGNED_USERS_ACTION
=
'i_code_review_user_assigned'
MR_REVIEW_REQUESTED_USERS_ACTION
=
'i_code_review_user_review_requested'
MR_APPROVAL_RULE_ADDED_USERS_ACTION
=
'i_code_review_user_approval_rule_added'
MR_APPROVAL_RULE_EDITED_USERS_ACTION
=
'i_code_review_user_approval_rule_edited'
MR_APPROVAL_RULE_DELETED_USERS_ACTION
=
'i_code_review_user_approval_rule_deleted'
MR_EDIT_MR_TITLE_ACTION
=
'i_code_review_edit_mr_title'
MR_EDIT_MR_DESC_ACTION
=
'i_code_review_edit_mr_desc'
...
...
@@ -118,6 +121,18 @@ module Gitlab
track_unique_action_by_user
(
MR_EDIT_MR_DESC_ACTION
,
user
)
end
def
track_approval_rule_added_action
(
user
:)
track_unique_action_by_user
(
MR_APPROVAL_RULE_ADDED_USERS_ACTION
,
user
)
end
def
track_approval_rule_edited_action
(
user
:)
track_unique_action_by_user
(
MR_APPROVAL_RULE_EDITED_USERS_ACTION
,
user
)
end
def
track_approval_rule_deleted_action
(
user
:)
track_unique_action_by_user
(
MR_APPROVAL_RULE_DELETED_USERS_ACTION
,
user
)
end
private
def
track_unique_action_by_merge_request
(
action
,
merge_request
)
...
...
spec/lib/gitlab/usage_data_counters/merge_request_activity_unique_counter_spec.rb
View file @
ac29d813
...
...
@@ -228,4 +228,28 @@ RSpec.describe Gitlab::UsageDataCounters::MergeRequestActivityUniqueCounter, :cl
let
(
:action
)
{
described_class
::
MR_REVIEW_REQUESTED_USERS_ACTION
}
end
end
describe
'.track_approval_rule_added_action'
do
subject
{
described_class
.
track_approval_rule_added_action
(
user:
user
)
}
it_behaves_like
'a tracked merge request unique event'
do
let
(
:action
)
{
described_class
::
MR_APPROVAL_RULE_ADDED_USERS_ACTION
}
end
end
describe
'.track_approval_rule_edited_action'
do
subject
{
described_class
.
track_approval_rule_edited_action
(
user:
user
)
}
it_behaves_like
'a tracked merge request unique event'
do
let
(
:action
)
{
described_class
::
MR_APPROVAL_RULE_EDITED_USERS_ACTION
}
end
end
describe
'.track_approval_rule_deleted_action'
do
subject
{
described_class
.
track_approval_rule_deleted_action
(
user:
user
)
}
it_behaves_like
'a tracked merge request unique event'
do
let
(
:action
)
{
described_class
::
MR_APPROVAL_RULE_DELETED_USERS_ACTION
}
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