summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/search/found_blob.rb3
-rw-r--r--lib/gitlab/usage_data_counters/issue_activity_unique_counter.rb6
-rw-r--r--lib/gitlab/usage_data_counters/known_events/common.yml4
3 files changed, 12 insertions, 1 deletions
diff --git a/lib/gitlab/search/found_blob.rb b/lib/gitlab/search/found_blob.rb
index 60d3e360984..79d6cfc84a3 100644
--- a/lib/gitlab/search/found_blob.rb
+++ b/lib/gitlab/search/found_blob.rb
@@ -9,7 +9,7 @@ module Gitlab
include Gitlab::Utils::StrongMemoize
include BlobActiveModel
- attr_reader :project, :content_match, :blob_path, :highlight_line
+ attr_reader :project, :content_match, :blob_path, :highlight_line, :matched_lines_count
PATH_REGEXP = /\A(?<ref>[^:]*):(?<path>[^\x00]*)\x00/.freeze
CONTENT_REGEXP = /^(?<ref>[^:]*):(?<path>[^\x00]*)\x00(?<startline>\d+)\x00/.freeze
@@ -25,6 +25,7 @@ module Gitlab
@binary_path = opts.fetch(:path, nil)
@binary_basename = opts.fetch(:basename, nil)
@ref = opts.fetch(:ref, nil)
+ @matched_lines_count = opts.fetch(:matched_lines_count, nil)
@startline = opts.fetch(:startline, nil)
@highlight_line = opts.fetch(:highlight_line, nil)
@binary_data = opts.fetch(:data, nil)
diff --git a/lib/gitlab/usage_data_counters/issue_activity_unique_counter.rb b/lib/gitlab/usage_data_counters/issue_activity_unique_counter.rb
index 477fa288874..a59ea36961d 100644
--- a/lib/gitlab/usage_data_counters/issue_activity_unique_counter.rb
+++ b/lib/gitlab/usage_data_counters/issue_activity_unique_counter.rb
@@ -34,6 +34,7 @@ module Gitlab
ISSUE_COMMENT_ADDED = 'g_project_management_issue_comment_added'
ISSUE_COMMENT_EDITED = 'g_project_management_issue_comment_edited'
ISSUE_COMMENT_REMOVED = 'g_project_management_issue_comment_removed'
+ ISSUE_DESIGN_COMMENT_REMOVED = 'g_project_management_issue_design_comments_removed'
class << self
def track_issue_created_action(author:, project:)
@@ -171,6 +172,11 @@ module Gitlab
track_unique_action(ISSUE_CLONED, author)
end
+ def track_issue_design_comment_removed_action(author:, project:)
+ track_snowplow_action(ISSUE_DESIGN_COMMENT_REMOVED, author, project)
+ track_unique_action(ISSUE_DESIGN_COMMENT_REMOVED, author)
+ end
+
private
def track_snowplow_action(event_name, author, project)
diff --git a/lib/gitlab/usage_data_counters/known_events/common.yml b/lib/gitlab/usage_data_counters/known_events/common.yml
index a64b7c4032b..5cd94722512 100644
--- a/lib/gitlab/usage_data_counters/known_events/common.yml
+++ b/lib/gitlab/usage_data_counters/known_events/common.yml
@@ -216,6 +216,10 @@
category: issues_edit
redis_slot: project_management
aggregation: daily
+- name: g_project_management_issue_design_comments_removed
+ category: issues_edit
+ redis_slot: project_management
+ aggregation: daily
- name: g_project_management_issue_time_estimate_changed
category: issues_edit
redis_slot: project_management