diff options
-rw-r--r-- | app/controllers/admin/application_settings_controller.rb | 14 | ||||
-rw-r--r-- | app/controllers/admin/projects_controller.rb | 12 | ||||
-rw-r--r-- | app/views/admin/application_settings/_form.html.haml | 6 | ||||
-rw-r--r-- | app/views/admin/projects/index.html.haml | 5 | ||||
-rw-r--r-- | config/routes.rb | 5 | ||||
-rw-r--r-- | doc/administration/repository_checks.md | 33 |
6 files changed, 32 insertions, 43 deletions
diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb index f010436bd36..993a70e63bc 100644 --- a/app/controllers/admin/application_settings_controller.rb +++ b/app/controllers/admin/application_settings_controller.rb @@ -19,6 +19,19 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController redirect_to admin_runners_path end + def clear_repository_check_states + Project.update_all( + last_repository_check_failed: false, + last_repository_check_at: nil + ) + + redirect_to( + admin_application_settings_path, + notice: 'All repository check states were cleared' + ) + end + + private def set_application_setting @@ -82,6 +95,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController :akismet_enabled, :akismet_api_key, :email_author_in_body, + :repository_checks_enabled, restricted_visibility_levels: [], import_sources: [] ) diff --git a/app/controllers/admin/projects_controller.rb b/app/controllers/admin/projects_controller.rb index 01257a68616..d7cd9520cc6 100644 --- a/app/controllers/admin/projects_controller.rb +++ b/app/controllers/admin/projects_controller.rb @@ -40,18 +40,6 @@ class Admin::ProjectsController < Admin::ApplicationController ) end - def clear_repository_check_states - Project.update_all( - last_repository_check_failed: false, - last_repository_check_at: nil - ) - - redirect_to( - admin_namespaces_projects_path, - notice: 'All project states were cleared' - ) - end - protected def project 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 diff --git a/config/routes.rb b/config/routes.rb index c0ed99b1964..c163602126d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -267,10 +267,6 @@ Rails.application.routes.draw do post :repository_check end - collection do - put :clear_repository_check_states - end - resources :runner_projects end end @@ -286,6 +282,7 @@ Rails.application.routes.draw do resource :application_settings, only: [:show, :update] do resources :services put :reset_runners_token + put :clear_repository_check_states end resources :labels diff --git a/doc/administration/repository_checks.md b/doc/administration/repository_checks.md index 77f28209f2f..e22b04928cc 100644 --- a/doc/administration/repository_checks.md +++ b/doc/administration/repository_checks.md @@ -4,12 +4,13 @@ _**Note:** This feature was [introduced][ce-3232] in GitLab 8.7_ --- -Git has a built-in mechanism [git fsck][git-fsck] to verify the -integrity of all data commited to a repository. GitLab administrators can -trigger such a check for a project via the admin panel. The checks run -asynchronously so it may take a few minutes before the check result is -visible on the project admin page. If the checks failed you can see their -output on the admin log page under 'repocheck.log'. +Git has a built-in mechanism \[git fsck\]\[git-fsck\] to verify the +integrity of all data commited to a repository. GitLab administrators +can trigger such a check for a project via the project page under the +admin panel. The checks run asynchronously so it may take a few minutes +before the check result is visible on the project admin page. If the +checks failed you can see their output on the admin log page under +'repocheck.log'. ## Periodical checks @@ -22,20 +23,8 @@ than once a day. ## Disabling periodic checks -You can disable the periodic checks by giving them an empty cron -schedule in gitlab.yml. - -``` -# For omnibus installations, in /etc/gitlab/gitlab.rb: -gitlab_rails['cron_jobs_repository_check_worker_cron'] = '' -``` - -``` -# For installations from source, in config/gitlab.yml: - cron_jobs: - repository_check_worker: - cron: "" -``` +You can disable the periodic checks on the 'Settings' page of the admin +panel. ## What to do if a check failed @@ -47,8 +36,8 @@ resolved the issue use the admin panel to trigger a new repository check on the project. This will clear the 'check failed' state. If for some reason the periodical repository check caused a lot of false -alarms you can choose to clear ALL repository check states from the admin -project index page. +alarms you can choose to clear ALL repository check states from the +'Settings' page of the admin panel. --- [ce-3232]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3232 "Auto git fsck" |