Extract logic from NotifyService into own services
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
The following discussion from !9768 (merged) should be addressed:
-
@ashmckenzie started a discussion: (+2 comments) Looking at the original naming of this class, I feel it's not longer an accurate name for what it's now going to be responsible for.
WDYT about splitting up the sending email logic and the creating issues logic into two separate classes? e.g.
class NotifyService < BaseService def execute(token) return false unless valid_version? return false unless valid_alert_manager_token?(token) SendEmailsFromAlerts.new(project, firings).execute if send_email? CreateIssuesFromAlerts.new(project, firings).execute if create_issue? persist_events true end endAlso, WDYT about encapsulating the logic around determining
incident_management_settinginto a separate class too?This should assist with:
Edited by 🤖 GitLab Bot 🤖
