Commit ce45fe71 authored by Jan Provaznik's avatar Jan Provaznik

Merge branch 'issue_354529' into 'master'

Move incident tracking module to correct services

See merge request gitlab-org/gitlab!82310
parents 58e25f20 7772788a
......@@ -9,10 +9,5 @@ module IncidentManagement
track_usage_event(:"incident_management_#{action}", current_user.id)
end
# No-op as optionally overridden in implementing classes.
# For use to provide checks before calling #track_incident_action.
def track_event
end
end
end
......@@ -2,8 +2,6 @@
module IssuableLinks
class CreateService < BaseService
include IncidentManagement::UsageData
attr_reader :issuable, :current_user, :params
def initialize(issuable, user, params)
......@@ -144,6 +142,10 @@ module IssuableLinks
def set_link_type(_link)
# no-op
end
def track_event
# no-op
end
end
end
......
......@@ -2,8 +2,6 @@
module IssuableLinks
class DestroyService < BaseService
include IncidentManagement::UsageData
attr_reader :link, :current_user, :source, :target
def initialize(link, user)
......@@ -41,5 +39,9 @@ module IssuableLinks
def not_found_message
'No Issue Link found'
end
def track_event
# no op
end
end
end
......@@ -2,6 +2,8 @@
module IssueLinks
class CreateService < IssuableLinks::CreateService
include IncidentManagement::UsageData
def linkable_issuables(issues)
@linkable_issuables ||= begin
issues.select { |issue| can?(current_user, :admin_issue_link, issue) }
......
......@@ -2,6 +2,8 @@
module IssueLinks
class DestroyService < IssuableLinks::DestroyService
include IncidentManagement::UsageData
private
def permission_to_remove_relation?
......
......@@ -111,7 +111,7 @@ module Notes
def track_event(note, user)
track_note_creation_usage_for_issues(note) if note.for_issue?
track_note_creation_usage_for_merge_requests(note) if note.for_merge_request?
track_usage_event(:incident_management_incident_comment, user.id) if note.for_issue? && note.noteable.incident?
track_incident_action(user, note.noteable, 'incident_comment') if note.for_issue?
if Feature.enabled?(:notes_create_service_tracking, project)
Gitlab::Tracking.event('Notes::CreateService', 'execute', **tracking_data_for(note))
......
......@@ -18,10 +18,9 @@ module EpicIssues
super
Epics::UpdateDatesService.new([link.epic]).execute
track_usage_ping_event
end
def track_usage_ping_event
def track_event
::Gitlab::UsageDataCounters::EpicActivityUniqueCounter.track_epic_issue_removed(author: current_user)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment