summaryrefslogtreecommitdiff
path: root/app/models/project_services
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-12-22 12:15:06 -0800
committerStan Hu <stanhu@gmail.com>2016-01-07 10:45:39 -0800
commit69209612e1793fcebcdb784074056d7a02b0f6f7 (patch)
tree2d9f791ec7f5e4a20f5f475a6151ee606d154812 /app/models/project_services
parent3c93e588e9a829bb805aab9ccafb94383f44ed57 (diff)
downloadgitlab-ce-69209612e1793fcebcdb784074056d7a02b0f6f7.tar.gz
Suppress e-mails on failed builds if allow_failure is set
Every time I push to GitLab, I get > 2 emails saying a spec failed when I don't care about benchmarks and other specs that have `allow_failure` set to `true`.
Diffstat (limited to 'app/models/project_services')
-rw-r--r--app/models/project_services/builds_email_service.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/project_services/builds_email_service.rb b/app/models/project_services/builds_email_service.rb
index 92c9b13c9b9..f6313255cbb 100644
--- a/app/models/project_services/builds_email_service.rb
+++ b/app/models/project_services/builds_email_service.rb
@@ -73,12 +73,16 @@ class BuildsEmailService < Service
when 'success'
!notify_only_broken_builds?
when 'failed'
- true
+ !allow_failure?(data)
else
false
end
end
+ def allow_failure?(data)
+ data[:build_allow_failure] == true
+ end
+
def all_recipients(data)
all_recipients = recipients.split(',')