Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
06f04b57
Commit
06f04b57
authored
Jul 24, 2020
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move send_email? to IncidentManagement::Settings
parent
0726fedf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
8 deletions
+5
-8
app/services/concerns/incident_management/settings.rb
app/services/concerns/incident_management/settings.rb
+3
-0
app/services/projects/alerting/notify_service.rb
app/services/projects/alerting/notify_service.rb
+0
-4
app/services/projects/prometheus/alerts/notify_service.rb
app/services/projects/prometheus/alerts/notify_service.rb
+2
-4
No files found.
app/services/concerns/incident_management/settings.rb
View file @
06f04b57
# frozen_string_literal: true
module
IncidentManagement
module
Settings
include
Gitlab
::
Utils
::
StrongMemoize
delegate
:send_email?
,
to: :incident_management_setting
def
incident_management_setting
strong_memoize
(
:incident_management_setting
)
do
project
.
incident_management_setting
||
...
...
app/services/projects/alerting/notify_service.rb
View file @
06f04b57
...
...
@@ -58,10 +58,6 @@ module Projects
AlertManagement
::
Alert
.
not_resolved
.
for_fingerprint
(
project
,
fingerprint
).
first
end
def
send_email?
incident_management_setting
.
send_email?
end
def
process_incident_issues
(
alert
)
return
if
alert
.
issue
...
...
app/services/projects/prometheus/alerts/notify_service.rb
View file @
06f04b57
...
...
@@ -42,10 +42,6 @@ module Projects
Gitlab
::
Utils
::
DeepSize
.
new
(
params
).
valid?
end
def
send_email?
incident_management_setting
.
send_email
&&
firings
.
any?
end
def
firings
@firings
||=
alerts_by_status
(
'firing'
)
end
...
...
@@ -125,6 +121,8 @@ module Projects
end
def
send_alert_email
return
unless
firings
.
any?
notification_service
.
async
.
prometheus_alerts_fired
(
project
,
firings
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment