Module: Gitlab::UsageDataCounters::MergeRequestActivityUniqueCounter

Defined in:
lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb

Constant Summary collapse

MR_DIFFS_ACTION =
'i_code_review_mr_diffs'
MR_DIFFS_SINGLE_FILE_ACTION =
'i_code_review_mr_single_file_diffs'
MR_DIFFS_USER_SINGLE_FILE_ACTION =
'i_code_review_user_single_file_diffs'
MR_CREATE_ACTION =
'i_code_review_user_create_mr'
MR_CLOSE_ACTION =
'i_code_review_user_close_mr'
MR_REOPEN_ACTION =
'i_code_review_user_reopen_mr'
MR_MERGE_ACTION =
'i_code_review_user_merge_mr'
MR_APPROVE_ACTION =
'i_code_review_user_approve_mr'
MR_UNAPPROVE_ACTION =
'i_code_review_user_unapprove_mr'
MR_CREATE_COMMENT_ACTION =
'i_code_review_user_create_mr_comment'
MR_EDIT_COMMENT_ACTION =
'i_code_review_user_edit_mr_comment'
MR_REMOVE_COMMENT_ACTION =
'i_code_review_user_remove_mr_comment'
MR_CREATE_REVIEW_NOTE_ACTION =
'i_code_review_user_create_review_note'
MR_PUBLISH_REVIEW_ACTION =
'i_code_review_user_publish_review'
MR_CREATE_MULTILINE_COMMENT_ACTION =
'i_code_review_user_create_multiline_mr_comment'
MR_EDIT_MULTILINE_COMMENT_ACTION =
'i_code_review_user_edit_multiline_mr_comment'
MR_REMOVE_MULTILINE_COMMENT_ACTION =
'i_code_review_user_remove_multiline_mr_comment'
MR_USER_ADD_SUGGESTION_ACTION =
'i_code_review_user_add_suggestion'
MR_TOTAL_ADD_SUGGESTION_ACTION =
'i_code_review_total_suggestions_added'
MR_USER_APPLY_SUGGESTION_ACTION =
'i_code_review_user_apply_suggestion'
MR_TOTAL_APPLY_SUGGESTION_ACTION =
'i_code_review_total_suggestions_applied'
MR_MARKED_AS_DRAFT_ACTION =
'i_code_review_user_marked_as_draft'
MR_UNMARKED_AS_DRAFT_ACTION =
'i_code_review_user_unmarked_as_draft'
MR_RESOLVE_THREAD_ACTION =
'i_code_review_user_resolve_thread'
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_TASK_ITEM_STATUS_CHANGED_ACTION =
'i_code_review_user_toggled_task_item_status'
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'
MR_CREATE_FROM_ISSUE_ACTION =
'i_code_review_user_create_mr_from_issue'
MR_DISCUSSION_LOCKED_ACTION =
'i_code_review_user_mr_discussion_locked'
MR_DISCUSSION_UNLOCKED_ACTION =
'i_code_review_user_mr_discussion_unlocked'
MR_TIME_ESTIMATE_CHANGED_ACTION =
'i_code_review_user_time_estimate_changed'
MR_TIME_SPENT_CHANGED_ACTION =
'i_code_review_user_time_spent_changed'
MR_ASSIGNEES_CHANGED_ACTION =
'i_code_review_user_assignees_changed'
MR_REVIEWERS_CHANGED_ACTION =
'i_code_review_user_reviewers_changed'
MR_INCLUDING_CI_CONFIG_ACTION =
'o_pipeline_authoring_unique_users_pushing_mr_ciconfigfile'
MR_MILESTONE_CHANGED_ACTION =
'i_code_review_user_milestone_changed'
MR_LABELS_CHANGED_ACTION =
'i_code_review_user_labels_changed'
MR_LOAD_CONFLICT_UI_ACTION =
'i_code_review_user_load_conflict_ui'
MR_RESOLVE_CONFLICT_ACTION =
'i_code_review_user_resolve_conflict'
MR_RESOLVE_THREAD_IN_ISSUE_ACTION =
'i_code_review_user_resolve_thread_in_issue'

Class Method Summary collapse

Class Method Details

.track_add_suggestion_action(note:) ⇒ Object


118
119
120
121
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 118

def track_add_suggestion_action(note:)
  track_unique_action_by_user(MR_USER_ADD_SUGGESTION_ACTION, note.author)
  track_unique_action_by_objects(MR_TOTAL_ADD_SUGGESTION_ACTION, note.suggestions)
end

.track_apply_suggestion_action(user:, suggestions:) ⇒ Object


131
132
133
134
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 131

def track_apply_suggestion_action(user:, suggestions:)
  track_unique_action_by_user(MR_USER_APPLY_SUGGESTION_ACTION, user)
  track_unique_action_by_objects(MR_TOTAL_APPLY_SUGGESTION_ACTION, suggestions)
end

.track_approval_rule_added_action(user:) ⇒ Object


152
153
154
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 152

def track_approval_rule_added_action(user:)
  track_unique_action_by_user(MR_APPROVAL_RULE_ADDED_USERS_ACTION, user)
end

.track_approval_rule_deleted_action(user:) ⇒ Object


160
161
162
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 160

def track_approval_rule_deleted_action(user:)
  track_unique_action_by_user(MR_APPROVAL_RULE_DELETED_USERS_ACTION, user)
end

.track_approval_rule_edited_action(user:) ⇒ Object


156
157
158
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 156

def track_approval_rule_edited_action(user:)
  track_unique_action_by_user(MR_APPROVAL_RULE_EDITED_USERS_ACTION, user)
end

.track_approve_mr_action(user:) ⇒ Object


79
80
81
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 79

def track_approve_mr_action(user:)
  track_unique_action_by_user(MR_APPROVE_ACTION, user)
end

.track_assignees_changed_action(user:) ⇒ Object


188
189
190
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 188

def track_assignees_changed_action(user:)
  track_unique_action_by_user(MR_ASSIGNEES_CHANGED_ACTION, user)
end

.track_close_mr_action(user:) ⇒ Object


67
68
69
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 67

def track_close_mr_action(user:)
  track_unique_action_by_user(MR_CLOSE_ACTION, user)
end

.track_create_comment_action(note:) ⇒ Object


95
96
97
98
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 95

def track_create_comment_action(note:)
  track_unique_action_by_user(MR_CREATE_COMMENT_ACTION, note.author)
  track_multiline_unique_action(MR_CREATE_MULTILINE_COMMENT_ACTION, note)
end

.track_create_mr_action(user:) ⇒ Object


63
64
65
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 63

def track_create_mr_action(user:)
  track_unique_action_by_user(MR_CREATE_ACTION, user)
end

.track_create_review_note_action(user:) ⇒ Object


110
111
112
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 110

def track_create_review_note_action(user:)
  track_unique_action_by_user(MR_CREATE_REVIEW_NOTE_ACTION, user)
end

.track_description_edit_action(user:) ⇒ Object


148
149
150
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 148

def track_description_edit_action(user:)
  track_unique_action_by_user(MR_EDIT_MR_DESC_ACTION, user)
end

.track_discussion_locked_action(user:) ⇒ Object


172
173
174
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 172

def track_discussion_locked_action(user:)
  track_unique_action_by_user(MR_DISCUSSION_LOCKED_ACTION, user)
end

.track_discussion_unlocked_action(user:) ⇒ Object


176
177
178
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 176

def track_discussion_unlocked_action(user:)
  track_unique_action_by_user(MR_DISCUSSION_UNLOCKED_ACTION, user)
end

.track_edit_comment_action(note:) ⇒ Object


100
101
102
103
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 100

def track_edit_comment_action(note:)
  track_unique_action_by_user(MR_EDIT_COMMENT_ACTION, note.author)
  track_multiline_unique_action(MR_EDIT_MULTILINE_COMMENT_ACTION, note)
end

.track_labels_changed_action(user:) ⇒ Object


206
207
208
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 206

def track_labels_changed_action(user:)
  track_unique_action_by_user(MR_LABELS_CHANGED_ACTION, user)
end

.track_loading_conflict_ui_action(user:) ⇒ Object


210
211
212
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 210

def track_loading_conflict_ui_action(user:)
  track_unique_action_by_user(MR_LOAD_CONFLICT_UI_ACTION, user)
end

.track_marked_as_draft_action(user:) ⇒ Object


123
124
125
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 123

def track_marked_as_draft_action(user:)
  track_unique_action_by_user(MR_MARKED_AS_DRAFT_ACTION, user)
end

.track_merge_mr_action(user:) ⇒ Object


71
72
73
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 71

def track_merge_mr_action(user:)
  track_unique_action_by_user(MR_MERGE_ACTION, user)
end

.track_milestone_changed_action(user:) ⇒ Object


202
203
204
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 202

def track_milestone_changed_action(user:)
  track_unique_action_by_user(MR_MILESTONE_CHANGED_ACTION, user)
end

.track_mr_create_from_issue(user:) ⇒ Object


168
169
170
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 168

def track_mr_create_from_issue(user:)
  track_unique_action_by_user(MR_CREATE_FROM_ISSUE_ACTION, user)
end

.track_mr_diffs_action(merge_request:) ⇒ Object


54
55
56
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 54

def track_mr_diffs_action(merge_request:)
  track_unique_action_by_merge_request(MR_DIFFS_ACTION, merge_request)
end

.track_mr_diffs_single_file_action(merge_request:, user:) ⇒ Object


58
59
60
61
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 58

def track_mr_diffs_single_file_action(merge_request:, user:)
  track_unique_action_by_merge_request(MR_DIFFS_SINGLE_FILE_ACTION, merge_request)
  track_unique_action_by_user(MR_DIFFS_USER_SINGLE_FILE_ACTION, user)
end

.track_mr_including_ci_config(user:, merge_request:) ⇒ Object


196
197
198
199
200
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 196

def track_mr_including_ci_config(user:, merge_request:)
  return unless merge_request.includes_ci_config?

  track_unique_action_by_user(MR_INCLUDING_CI_CONFIG_ACTION, user)
end

.track_publish_review_action(user:) ⇒ Object


114
115
116
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 114

def track_publish_review_action(user:)
  track_unique_action_by_user(MR_PUBLISH_REVIEW_ACTION, user)
end

.track_remove_comment_action(note:) ⇒ Object


105
106
107
108
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 105

def track_remove_comment_action(note:)
  track_unique_action_by_user(MR_REMOVE_COMMENT_ACTION, note.author)
  track_multiline_unique_action(MR_REMOVE_MULTILINE_COMMENT_ACTION, note)
end

.track_reopen_mr_action(user:) ⇒ Object


75
76
77
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 75

def track_reopen_mr_action(user:)
  track_unique_action_by_user(MR_REOPEN_ACTION, user)
end

.track_resolve_conflict_action(user:) ⇒ Object


214
215
216
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 214

def track_resolve_conflict_action(user:)
  track_unique_action_by_user(MR_RESOLVE_CONFLICT_ACTION, user)
end

.track_resolve_thread_action(user:) ⇒ Object


87
88
89
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 87

def track_resolve_thread_action(user:)
  track_unique_action_by_user(MR_RESOLVE_THREAD_ACTION, user)
end

.track_resolve_thread_in_issue_action(user:) ⇒ Object


218
219
220
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 218

def track_resolve_thread_in_issue_action(user:)
  track_unique_action_by_user(MR_RESOLVE_THREAD_IN_ISSUE_ACTION, user)
end

.track_reviewers_changed_action(user:) ⇒ Object


192
193
194
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 192

def track_reviewers_changed_action(user:)
  track_unique_action_by_user(MR_REVIEWERS_CHANGED_ACTION, user)
end

.track_task_item_status_changed(user:) ⇒ Object


164
165
166
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 164

def track_task_item_status_changed(user:)
  track_unique_action_by_user(MR_TASK_ITEM_STATUS_CHANGED_ACTION, user)
end

.track_time_estimate_changed_action(user:) ⇒ Object


180
181
182
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 180

def track_time_estimate_changed_action(user:)
  track_unique_action_by_user(MR_TIME_ESTIMATE_CHANGED_ACTION, user)
end

.track_time_spent_changed_action(user:) ⇒ Object


184
185
186
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 184

def track_time_spent_changed_action(user:)
  track_unique_action_by_user(MR_TIME_SPENT_CHANGED_ACTION, user)
end

.track_title_edit_action(user:) ⇒ Object


144
145
146
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 144

def track_title_edit_action(user:)
  track_unique_action_by_user(MR_EDIT_MR_TITLE_ACTION, user)
end

.track_unapprove_mr_action(user:) ⇒ Object


83
84
85
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 83

def track_unapprove_mr_action(user:)
  track_unique_action_by_user(MR_UNAPPROVE_ACTION, user)
end

.track_unmarked_as_draft_action(user:) ⇒ Object


127
128
129
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 127

def track_unmarked_as_draft_action(user:)
  track_unique_action_by_user(MR_UNMARKED_AS_DRAFT_ACTION, user)
end

.track_unresolve_thread_action(user:) ⇒ Object


91
92
93
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 91

def track_unresolve_thread_action(user:)
  track_unique_action_by_user(MR_UNRESOLVE_THREAD_ACTION, user)
end

.track_users_assigned_to_mr(users:) ⇒ Object


136
137
138
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 136

def track_users_assigned_to_mr(users:)
  track_unique_action_by_objects(MR_ASSIGNED_USERS_ACTION, users)
end

.track_users_review_requested(users:) ⇒ Object


140
141
142
# File 'lib/gitlab/usage_data_counters/merge_request_activity_unique_counter.rb', line 140

def track_users_review_requested(users:)
  track_unique_action_by_objects(MR_REVIEW_REQUESTED_USERS_ACTION, users)
end