summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-04-19 09:00:01 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2016-04-19 09:00:01 +0000
commit2234ac520b2bf35ae900641446fecceaeaff2ebb (patch)
tree1e0f97571ea366200e201bd22da89a25e94e7bc6 /app
parent53a1d705fe536ad373faa77ba1ef5196ff49a98b (diff)
parent1394ccfe834c4e34bed701d206c77961a594fa23 (diff)
downloadgitlab-ce-2234ac520b2bf35ae900641446fecceaeaff2ebb.tar.gz
Merge branch 'auto-fsck-skip-wiki' into 'master'
Improve 'auto fsck' feature - skip wiki repositories when they are disabled (avoids false alarms) - more context in admin alert emails Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/15332 See merge request !3781
Diffstat (limited to 'app')
-rw-r--r--app/mailers/repository_check_mailer.rb2
-rw-r--r--app/views/repository_check_mailer/notify.html.haml3
-rw-r--r--app/views/repository_check_mailer/notify.text.haml3
-rw-r--r--app/workers/repository_check/single_repository_worker.rb6
4 files changed, 10 insertions, 4 deletions
diff --git a/app/mailers/repository_check_mailer.rb b/app/mailers/repository_check_mailer.rb
index 2bff5b63cc4..21db2fe04a0 100644
--- a/app/mailers/repository_check_mailer.rb
+++ b/app/mailers/repository_check_mailer.rb
@@ -8,7 +8,7 @@ class RepositoryCheckMailer < BaseMailer
mail(
to: User.admins.pluck(:email),
- subject: @message
+ subject: "GitLab Admin | #{@message}"
)
end
end
diff --git a/app/views/repository_check_mailer/notify.html.haml b/app/views/repository_check_mailer/notify.html.haml
index df16f503570..a585147ddd1 100644
--- a/app/views/repository_check_mailer/notify.html.haml
+++ b/app/views/repository_check_mailer/notify.html.haml
@@ -3,3 +3,6 @@
%p
= link_to "See the affected projects in the GitLab admin panel", admin_namespaces_projects_url(last_repository_check_failed: 1)
+
+%p
+ You are receiving this message because you are a GitLab administrator for #{Gitlab.config.gitlab.url}.
diff --git a/app/views/repository_check_mailer/notify.text.haml b/app/views/repository_check_mailer/notify.text.haml
index 02f3f80288a..93db151329e 100644
--- a/app/views/repository_check_mailer/notify.text.haml
+++ b/app/views/repository_check_mailer/notify.text.haml
@@ -1,3 +1,6 @@
#{@message}.
\
View details: #{admin_namespaces_projects_url(last_repository_check_failed: 1)}
+
+You are receiving this message because you are a GitLab administrator
+for #{Gitlab.config.gitlab.url}.
diff --git a/app/workers/repository_check/single_repository_worker.rb b/app/workers/repository_check/single_repository_worker.rb
index e54ae86d06c..a76729e3c74 100644
--- a/app/workers/repository_check/single_repository_worker.rb
+++ b/app/workers/repository_check/single_repository_worker.rb
@@ -15,10 +15,10 @@ module RepositoryCheck
private
def check(project)
+ repositories = [project.repository]
+ repositories << project.wiki.repository if project.wiki_enabled?
# Use 'map do', not 'all? do', to prevent short-circuiting
- [project.repository, project.wiki.repository].map do |repository|
- git_fsck(repository.path_to_repo)
- end.all?
+ repositories.map { |repository| git_fsck(repository.path_to_repo) }.all?
end
def git_fsck(path)