From bf9526739b5c90790907c1d8b9410dd339e3d395 Mon Sep 17 00:00:00 2001
From: Jacob Vosmaer <contact@jacobvosmaer.nl>
Date: Mon, 4 Apr 2016 17:23:43 +0200
Subject: Rebase repo check MR

---
 app/views/admin/logs/show.html.haml          |  3 ++-
 app/views/admin/projects/index.html.haml     | 15 +++++++++++--
 app/views/admin/projects/show.html.haml      | 32 ++++++++++++++++++++++++++++
 app/views/repo_check_mailer/notify.html.haml |  5 +++++
 app/views/repo_check_mailer/notify.text.haml |  3 +++
 5 files changed, 55 insertions(+), 3 deletions(-)
 create mode 100644 app/views/repo_check_mailer/notify.html.haml
 create mode 100644 app/views/repo_check_mailer/notify.text.haml

(limited to 'app/views')

diff --git a/app/views/admin/logs/show.html.haml b/app/views/admin/logs/show.html.haml
index af9fdeb0734..abcc93f4046 100644
--- a/app/views/admin/logs/show.html.haml
+++ b/app/views/admin/logs/show.html.haml
@@ -1,6 +1,7 @@
 - page_title "Logs"
 - loggers = [Gitlab::GitLogger, Gitlab::AppLogger,
-             Gitlab::ProductionLogger, Gitlab::SidekiqLogger]
+             Gitlab::ProductionLogger, Gitlab::SidekiqLogger,
+             Gitlab::RepoCheckLogger]
 %ul.nav-links.log-tabs
   - loggers.each do |klass|
     %li{ class: (klass == Gitlab::GitLogger ? 'active' : '') }
diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml
index d39c0f44031..ed360f2f012 100644
--- a/app/views/admin/projects/index.html.haml
+++ b/app/views/admin/projects/index.html.haml
@@ -3,7 +3,7 @@
 
 .row.prepend-top-default
   %aside.col-md-3
-    .admin-filter
+    .panel.admin-filter
       = form_tag admin_namespaces_projects_path, method: :get, class: '' do
         .form-group
           = label_tag :name, 'Name:'
@@ -38,11 +38,22 @@
                   %span.descr
                     = visibility_level_icon(level)
                     = label
-        %hr
+        %fieldset
+          %strong Problems
+          .checkbox
+            = label_tag :last_repo_check_failed do
+              = check_box_tag :last_repo_check_failed, 1, params[:last_repo_check_failed]
+              %span Last repo check failed
+
         = hidden_field_tag :sort, params[:sort]
         = button_tag "Search", class: "btn submit btn-primary"
         = link_to "Reset", admin_namespaces_projects_path, class: "btn btn-cancel"
 
+    .panel.panel-default.repo-check-states
+      .panel-heading
+        Repo check states
+      .panel-body
+        = link_to 'Clear all', clear_repo_check_states_admin_namespace_projects_path(0), data: { confirm: 'This will clear repo check states for ALL projects in the database. This cannot be undone. Are you sure?' }, method: :put, class: "btn btn-sm btn-remove"
   %section.col-md-9
     .panel.panel-default
       .panel-heading
diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml
index c638c32a654..a7a3f6349ef 100644
--- a/app/views/admin/projects/show.html.haml
+++ b/app/views/admin/projects/show.html.haml
@@ -5,6 +5,14 @@
     %i.fa.fa-pencil-square-o
     Edit
 %hr
+- if @project.last_repo_check_failed?
+  .row
+    .col-md-12
+      .panel
+        .panel-heading.alert.alert-danger
+          Last repo check failed. See
+          = link_to 'repocheck.log', admin_logs_path
+          for error messages.
 .row
   .col-md-6
     .panel.panel-default
@@ -95,6 +103,30 @@
             .col-sm-offset-2.col-sm-10
               = f.submit 'Transfer', class: 'btn btn-primary'
 
+    .panel.panel-default.repo-check
+      .panel-heading
+        Repo check
+      .panel-body
+        = form_for @project, url: repo_check_admin_namespace_project_path(@project.namespace, @project), method: :post do |f|
+          .form-group
+            - if @project.last_repo_check_at.nil?
+              This repository has never been checked.
+            - else
+              This repository was last checked
+              = @project.last_repo_check_at.to_s(:medium) + '.'
+              The check
+              - if @project.last_repo_check_failed?
+                = succeed '.' do
+                  %strong.cred failed
+                See
+                = link_to 'repocheck.log', admin_logs_path
+                for error messages.
+              - else
+                passed.
+
+          .form-group
+            = f.submit 'Trigger repo check', class: 'btn btn-primary'
+
   .col-md-6
     - if @group
       .panel.panel-default
diff --git a/app/views/repo_check_mailer/notify.html.haml b/app/views/repo_check_mailer/notify.html.haml
new file mode 100644
index 00000000000..ef0016f9d3e
--- /dev/null
+++ b/app/views/repo_check_mailer/notify.html.haml
@@ -0,0 +1,5 @@
+%p
+  #{@message}.
+
+%p
+  = link_to "See the affected projects in the GitLab admin panel", admin_namespaces_projects_url(last_repo_check_failed: 1)
diff --git a/app/views/repo_check_mailer/notify.text.haml b/app/views/repo_check_mailer/notify.text.haml
new file mode 100644
index 00000000000..bdf8c2ad675
--- /dev/null
+++ b/app/views/repo_check_mailer/notify.text.haml
@@ -0,0 +1,3 @@
+#{@message}.
+\
+View details: #{admin_namespaces_projects_url(last_repo_check_failed: 1)}
-- 
cgit v1.2.1


From 5cf56e56470e695b10db02dff70d0f0b50060518 Mon Sep 17 00:00:00 2001
From: Jacob Vosmaer <contact@jacobvosmaer.nl>
Date: Wed, 6 Apr 2016 13:47:05 +0200
Subject: Rename almost all the things

---
 app/views/admin/logs/show.html.haml                |  2 +-
 app/views/admin/projects/index.html.haml           | 12 ++++++------
 app/views/admin/projects/show.html.haml            | 18 +++++++++---------
 app/views/repo_check_mailer/notify.html.haml       |  5 -----
 app/views/repo_check_mailer/notify.text.haml       |  3 ---
 app/views/repository_check_mailer/notify.html.haml |  5 +++++
 app/views/repository_check_mailer/notify.text.haml |  3 +++
 7 files changed, 24 insertions(+), 24 deletions(-)
 delete mode 100644 app/views/repo_check_mailer/notify.html.haml
 delete mode 100644 app/views/repo_check_mailer/notify.text.haml
 create mode 100644 app/views/repository_check_mailer/notify.html.haml
 create mode 100644 app/views/repository_check_mailer/notify.text.haml

(limited to 'app/views')

diff --git a/app/views/admin/logs/show.html.haml b/app/views/admin/logs/show.html.haml
index abcc93f4046..4b475a4d8fa 100644
--- a/app/views/admin/logs/show.html.haml
+++ b/app/views/admin/logs/show.html.haml
@@ -1,7 +1,7 @@
 - page_title "Logs"
 - loggers = [Gitlab::GitLogger, Gitlab::AppLogger,
              Gitlab::ProductionLogger, Gitlab::SidekiqLogger,
-             Gitlab::RepoCheckLogger]
+             Gitlab::RepositoryCheckLogger]
 %ul.nav-links.log-tabs
   - loggers.each do |klass|
     %li{ class: (klass == Gitlab::GitLogger ? 'active' : '') }
diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml
index ed360f2f012..c2bf0659841 100644
--- a/app/views/admin/projects/index.html.haml
+++ b/app/views/admin/projects/index.html.haml
@@ -41,19 +41,19 @@
         %fieldset
           %strong Problems
           .checkbox
-            = label_tag :last_repo_check_failed do
-              = check_box_tag :last_repo_check_failed, 1, params[:last_repo_check_failed]
-              %span Last repo check failed
+            = label_tag :last_repository_check_failed do
+              = check_box_tag :last_repository_check_failed, 1, params[:last_repository_check_failed]
+              %span Last repository check failed
 
         = hidden_field_tag :sort, params[:sort]
         = button_tag "Search", class: "btn submit btn-primary"
         = link_to "Reset", admin_namespaces_projects_path, class: "btn btn-cancel"
 
-    .panel.panel-default.repo-check-states
+    .panel.panel-default.repository-check-states
       .panel-heading
-        Repo check states
+        Repository check states
       .panel-body
-        = link_to 'Clear all', clear_repo_check_states_admin_namespace_projects_path(0), data: { confirm: 'This will clear repo check states for ALL projects in the database. This cannot be undone. Are you sure?' }, method: :put, class: "btn btn-sm btn-remove"
+        = link_to 'Clear all', clear_repository_check_states_admin_namespace_projects_path(0), data: { confirm: 'This will clear repository check states for ALL projects in the database. This cannot be undone. Are you sure?' }, method: :put, class: "btn btn-sm btn-remove"
   %section.col-md-9
     .panel.panel-default
       .panel-heading
diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml
index a7a3f6349ef..5bef8e3ad57 100644
--- a/app/views/admin/projects/show.html.haml
+++ b/app/views/admin/projects/show.html.haml
@@ -5,12 +5,12 @@
     %i.fa.fa-pencil-square-o
     Edit
 %hr
-- if @project.last_repo_check_failed?
+- if @project.last_repository_check_failed?
   .row
     .col-md-12
       .panel
         .panel-heading.alert.alert-danger
-          Last repo check failed. See
+          Last repository check failed. See
           = link_to 'repocheck.log', admin_logs_path
           for error messages.
 .row
@@ -103,19 +103,19 @@
             .col-sm-offset-2.col-sm-10
               = f.submit 'Transfer', class: 'btn btn-primary'
 
-    .panel.panel-default.repo-check
+    .panel.panel-default.repository-check
       .panel-heading
-        Repo check
+        Repository check
       .panel-body
-        = form_for @project, url: repo_check_admin_namespace_project_path(@project.namespace, @project), method: :post do |f|
+        = form_for @project, url: repository_check_admin_namespace_project_path(@project.namespace, @project), method: :post do |f|
           .form-group
-            - if @project.last_repo_check_at.nil?
+            - if @project.last_repository_check_at.nil?
               This repository has never been checked.
             - else
               This repository was last checked
-              = @project.last_repo_check_at.to_s(:medium) + '.'
+              = @project.last_repository_check_at.to_s(:medium) + '.'
               The check
-              - if @project.last_repo_check_failed?
+              - if @project.last_repository_check_failed?
                 = succeed '.' do
                   %strong.cred failed
                 See
@@ -125,7 +125,7 @@
                 passed.
 
           .form-group
-            = f.submit 'Trigger repo check', class: 'btn btn-primary'
+            = f.submit 'Trigger repository check', class: 'btn btn-primary'
 
   .col-md-6
     - if @group
diff --git a/app/views/repo_check_mailer/notify.html.haml b/app/views/repo_check_mailer/notify.html.haml
deleted file mode 100644
index ef0016f9d3e..00000000000
--- a/app/views/repo_check_mailer/notify.html.haml
+++ /dev/null
@@ -1,5 +0,0 @@
-%p
-  #{@message}.
-
-%p
-  = link_to "See the affected projects in the GitLab admin panel", admin_namespaces_projects_url(last_repo_check_failed: 1)
diff --git a/app/views/repo_check_mailer/notify.text.haml b/app/views/repo_check_mailer/notify.text.haml
deleted file mode 100644
index bdf8c2ad675..00000000000
--- a/app/views/repo_check_mailer/notify.text.haml
+++ /dev/null
@@ -1,3 +0,0 @@
-#{@message}.
-\
-View details: #{admin_namespaces_projects_url(last_repo_check_failed: 1)}
diff --git a/app/views/repository_check_mailer/notify.html.haml b/app/views/repository_check_mailer/notify.html.haml
new file mode 100644
index 00000000000..df16f503570
--- /dev/null
+++ b/app/views/repository_check_mailer/notify.html.haml
@@ -0,0 +1,5 @@
+%p
+  #{@message}.
+
+%p
+  = link_to "See the affected projects in the GitLab admin panel", admin_namespaces_projects_url(last_repository_check_failed: 1)
diff --git a/app/views/repository_check_mailer/notify.text.haml b/app/views/repository_check_mailer/notify.text.haml
new file mode 100644
index 00000000000..02f3f80288a
--- /dev/null
+++ b/app/views/repository_check_mailer/notify.text.haml
@@ -0,0 +1,3 @@
+#{@message}.
+\
+View details: #{admin_namespaces_projects_url(last_repository_check_failed: 1)}
-- 
cgit v1.2.1


From 97f4ffff1e7b5da94e18edc20c009ffb46784187 Mon Sep 17 00:00:00 2001
From: Jacob Vosmaer <contact@jacobvosmaer.nl>
Date: Tue, 12 Apr 2016 17:07:54 +0200
Subject: Add a 'circuit breaker' for repo checks

---
 app/views/admin/application_settings/_form.html.haml | 13 +++++++++++++
 1 file changed, 13 insertions(+)

(limited to 'app/views')

diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml
index de86dacbb12..afd88465a78 100644
--- a/app/views/admin/application_settings/_form.html.haml
+++ b/app/views/admin/application_settings/_form.html.haml
@@ -275,5 +275,18 @@
       .col-sm-10
         = f.text_field :sentry_dsn, class: 'form-control'
 
+  %fieldset
+    %legend Repository Checks
+    .form-group
+      .col-sm-offset-2.col-sm-10
+        .checkbox
+          = f.label :repository_checks_enabled do
+            = f.check_box :repository_checks_enabled
+            Enable Repository Checks
+          .help-block
+            GitLab will periodically run 
+            %a{ href: 'https://www.kernel.org/pub/software/scm/git/docs/git-fsck.html', target: 'blank' } 'git fsck'
+            in all project and wiki repositories to look for silent disk corruption issues.
+
   .form-actions
     = f.submit 'Save', class: 'btn btn-save'
-- 
cgit v1.2.1


From ea787165b3a9604aa86304e29778066bb014824e Mon Sep 17 00:00:00 2001
From: Jacob Vosmaer <contact@jacobvosmaer.nl>
Date: Tue, 12 Apr 2016 17:32:58 +0200
Subject: Move 'clear checks' button to applicatoin settings

---
 app/views/admin/application_settings/_form.html.haml | 6 ++++++
 app/views/admin/projects/index.html.haml             | 5 -----
 2 files changed, 6 insertions(+), 5 deletions(-)

(limited to 'app/views')

diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml
index afd88465a78..c7c82da72c7 100644
--- a/app/views/admin/application_settings/_form.html.haml
+++ b/app/views/admin/application_settings/_form.html.haml
@@ -287,6 +287,12 @@
             GitLab will periodically run 
             %a{ href: 'https://www.kernel.org/pub/software/scm/git/docs/git-fsck.html', target: 'blank' } 'git fsck'
             in all project and wiki repositories to look for silent disk corruption issues.
+    .form-group
+      .col-sm-offset-2.col-sm-10
+        = link_to 'Clear all repository checks', clear_repository_check_states_admin_application_settings_path, data: { confirm: 'This will clear repository check states for ALL projects in the database. This cannot be undone. Are you sure?' }, method: :put, class: "btn btn-sm btn-remove"
+        .help-block
+          If you got a lot of false alarms from repository checks (maybe your fileserver was temporarily unavailable) you can choose to clear all repository check information from the database.
+ 
 
   .form-actions
     = f.submit 'Save', class: 'btn btn-save'
diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml
index c2bf0659841..aa07afa0d62 100644
--- a/app/views/admin/projects/index.html.haml
+++ b/app/views/admin/projects/index.html.haml
@@ -49,11 +49,6 @@
         = button_tag "Search", class: "btn submit btn-primary"
         = link_to "Reset", admin_namespaces_projects_path, class: "btn btn-cancel"
 
-    .panel.panel-default.repository-check-states
-      .panel-heading
-        Repository check states
-      .panel-body
-        = link_to 'Clear all', clear_repository_check_states_admin_namespace_projects_path(0), data: { confirm: 'This will clear repository check states for ALL projects in the database. This cannot be undone. Are you sure?' }, method: :put, class: "btn btn-sm btn-remove"
   %section.col-md-9
     .panel.panel-default
       .panel-heading
-- 
cgit v1.2.1


From 525ab25ac81a6b81cca56d3cba403ab2a5f372eb Mon Sep 17 00:00:00 2001
From: Jacob Vosmaer <contact@jacobvosmaer.nl>
Date: Tue, 12 Apr 2016 18:15:15 +0200
Subject: Changes suggested by Robert

---
 app/views/admin/application_settings/_form.html.haml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'app/views')

diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml
index 533a2f42973..555aea554f0 100644
--- a/app/views/admin/application_settings/_form.html.haml
+++ b/app/views/admin/application_settings/_form.html.haml
@@ -287,7 +287,7 @@
       .col-sm-offset-2.col-sm-10
         = link_to 'Clear all repository checks', clear_repository_check_states_admin_application_settings_path, data: { confirm: 'This will clear repository check states for ALL projects in the database. This cannot be undone. Are you sure?' }, method: :put, class: "btn btn-sm btn-remove"
         .help-block
-          If you got a lot of false alarms from repository checks (maybe your fileserver was temporarily unavailable) you can choose to clear all repository check information from the database.
+          If you got a lot of false alarms from repository checks you can choose to clear all repository check information from the database.
  
 
   .form-actions
-- 
cgit v1.2.1


From da87fa8a9fb2e786a4115d2da3898e0ec83c446c Mon Sep 17 00:00:00 2001
From: Jacob Vosmaer <contact@jacobvosmaer.nl>
Date: Wed, 13 Apr 2016 11:50:39 +0200
Subject: Make check result staleness more obvious

---
 app/views/admin/projects/show.html.haml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'app/views')

diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml
index 5bef8e3ad57..1e44172f066 100644
--- a/app/views/admin/projects/show.html.haml
+++ b/app/views/admin/projects/show.html.haml
@@ -10,7 +10,9 @@
     .col-md-12
       .panel
         .panel-heading.alert.alert-danger
-          Last repository check failed. See
+          Last repository check 
+          = "(#{time_ago_in_words(@project.last_repository_check_at)} ago)"
+          failed. See
           = link_to 'repocheck.log', admin_logs_path
           for error messages.
 .row
-- 
cgit v1.2.1


From 91cebb7289df872ae4887f7103f68a6f948ee61c Mon Sep 17 00:00:00 2001
From: Jacob Vosmaer <contact@jacobvosmaer.nl>
Date: Thu, 14 Apr 2016 17:04:18 +0200
Subject: Documentation / help improvements

---
 app/views/admin/projects/show.html.haml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'app/views')

diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml
index 1e44172f066..73986d21bcf 100644
--- a/app/views/admin/projects/show.html.haml
+++ b/app/views/admin/projects/show.html.haml
@@ -10,7 +10,7 @@
     .col-md-12
       .panel
         .panel-heading.alert.alert-danger
-          Last repository check 
+          Last repository check
           = "(#{time_ago_in_words(@project.last_repository_check_at)} ago)"
           failed. See
           = link_to 'repocheck.log', admin_logs_path
@@ -126,6 +126,8 @@
               - else
                 passed.
 
+            = link_to icon('question-circle'), help_page_path('administration', 'repository_checks')
+
           .form-group
             = f.submit 'Trigger repository check', class: 'btn btn-primary'
 
-- 
cgit v1.2.1