diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-11 00:08:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-11 00:08:28 +0300 |
commit | 5ec9ab0e8cc7293a364235d6cc57f6a77dce2c38 (patch) | |
tree | fa5a41398bf9a568e6cb979917d0938b6cc2a5a6 /app/services/notes | |
parent | c596046be917b250019fdfb509be85cfb48df152 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/notes')
-rw-r--r-- | app/services/notes/create_service.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/services/notes/create_service.rb b/app/services/notes/create_service.rb index 4f2329a42f2..446d884be47 100644 --- a/app/services/notes/create_service.rb +++ b/app/services/notes/create_service.rb @@ -2,6 +2,8 @@ module Notes class CreateService < ::Notes::BaseService + include IncidentManagement::UsageData + def execute note = Notes::BuildService.new(project, current_user, params.except(:merge_request_diff_head_sha)).execute @@ -62,6 +64,7 @@ module Notes clear_noteable_diffs_cache(note) Suggestions::CreateService.new(note).execute increment_usage_counter(note) + track_event(note, current_user) if Feature.enabled?(:notes_create_service_tracking, project) Gitlab::Tracking.event('Notes::CreateService', 'execute', tracking_data_for(note)) @@ -104,5 +107,11 @@ module Notes value: note.id } end + + def track_event(note, user) + return unless note.noteable.is_a?(Issue) && note.noteable.incident? + + track_usage_event(:incident_management_incident_comment, user) + end end end |