Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-01-08 20:31:35 +0300
committerStan Hu <stanhu@gmail.com>2016-01-08 20:31:35 +0300
commit7403df6ca7bd31cd002d6fcf3bf4aa02dd4478eb (patch)
tree199fcaf1278a6e1b87f57cbd7cd43e172b382561 /app
parent8429f6f409eb8911d21095bc0fff3db2e53efd22 (diff)
parent69209612e1793fcebcdb784074056d7a02b0f6f7 (diff)
Merge branch 'suppress-allow-failure-builds' into 'master'
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 the benchmarks and others that have `allow_failure` set to `true`. @ayufan mentioned creating a summary e-mail to prevent getting one e-mail per build, but the latter might actually be desirable. For example, I do want to know if Rubocop errors fail right away. See merge request !2178
Diffstat (limited to 'app')
-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(',')