diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-10-05 20:06:31 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-10-05 20:06:31 +0200 |
commit | f088ffe8f7a8b9ef429f2fb0fbdfd45fa37cde20 (patch) | |
tree | d3bf78bcd464177800cfd466f9ebda114e8d8a71 | |
parent | 3eef0e18e0d4561c320b4a5d9c17d7ae7aaa3d42 (diff) | |
parent | fc59c45d58124c4fc23d62ad2ed65cbfd6cb3563 (diff) | |
download | gitlab-ce-f088ffe8f7a8b9ef429f2fb0fbdfd45fa37cde20.tar.gz |
Merge branch 'rs-remove-ci-disable'
See merge request !1512
-rw-r--r-- | app/controllers/admin/application_settings_controller.rb | 1 | ||||
-rw-r--r-- | app/controllers/ci/application_controller.rb | 9 | ||||
-rw-r--r-- | app/controllers/ci/projects_controller.rb | 8 | ||||
-rw-r--r-- | app/models/application_setting.rb | 3 | ||||
-rw-r--r-- | app/views/admin/application_settings/_form.html.haml | 9 | ||||
-rw-r--r-- | app/views/ci/projects/disabled.html.haml | 1 | ||||
-rw-r--r-- | config/initializers/1_settings.rb | 1 | ||||
-rw-r--r-- | db/migrate/20151005162154_remove_ci_enabled_from_application_settings.rb | 5 | ||||
-rw-r--r-- | db/schema.rb | 3 | ||||
-rw-r--r-- | lib/ci/api/api.rb | 4 | ||||
-rw-r--r-- | lib/ci/api/helpers.rb | 6 |
11 files changed, 9 insertions, 41 deletions
diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb index 5f70582cbb7..7c134d2ec9b 100644 --- a/app/controllers/admin/application_settings_controller.rb +++ b/app/controllers/admin/application_settings_controller.rb @@ -56,7 +56,6 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController :restricted_signup_domains_raw, :version_check_enabled, :user_oauth_applications, - :ci_enabled, restricted_visibility_levels: [], import_sources: [] ) diff --git a/app/controllers/ci/application_controller.rb b/app/controllers/ci/application_controller.rb index d8227e632e4..9be470660e6 100644 --- a/app/controllers/ci/application_controller.rb +++ b/app/controllers/ci/application_controller.rb @@ -1,7 +1,5 @@ module Ci class ApplicationController < ::ApplicationController - before_action :check_enable_flag! - def self.railtie_helpers_paths "app/helpers/ci" end @@ -10,13 +8,6 @@ module Ci private - def check_enable_flag! - unless current_application_settings.ci_enabled - redirect_to(disabled_ci_projects_path) - return - end - end - def authenticate_public_page! unless project.public authenticate_user! diff --git a/app/controllers/ci/projects_controller.rb b/app/controllers/ci/projects_controller.rb index 20e6c2c2ba7..33b8ae64659 100644 --- a/app/controllers/ci/projects_controller.rb +++ b/app/controllers/ci/projects_controller.rb @@ -3,17 +3,13 @@ module Ci before_action :authenticate_user!, except: [:build, :badge, :show] before_action :authenticate_public_page!, only: :show before_action :project, only: [:build, :show, :badge, :toggle_shared_runners, :dumped_yaml] - before_action :authorize_access_project!, except: [:build, :badge, :show, :new, :disabled] + before_action :authorize_access_project!, except: [:build, :badge, :show, :new] before_action :authorize_manage_project!, only: [:toggle_shared_runners, :dumped_yaml] before_action :authenticate_token!, only: [:build] before_action :no_cache, only: [:badge] - skip_before_action :check_enable_flag!, only: [:disabled] protect_from_forgery except: :build - layout 'ci/project', except: [:index, :disabled] - - def disabled - end + layout 'ci/project', except: [:index] def show @ref = params[:ref] diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index 784f5c96a0a..c8841178e93 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -83,8 +83,7 @@ class ApplicationSetting < ActiveRecord::Base default_project_visibility: Settings.gitlab.default_projects_features['visibility_level'], default_snippet_visibility: Settings.gitlab.default_projects_features['visibility_level'], restricted_signup_domains: Settings.gitlab['restricted_signup_domains'], - import_sources: ['github','bitbucket','gitlab','gitorious','google_code','fogbugz','git'], - ci_enabled: Settings.gitlab_ci['enabled'] + import_sources: ['github','bitbucket','gitlab','gitorious','google_code','fogbugz','git'] ) end diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml index 143cd10c543..a36ae0b766c 100644 --- a/app/views/admin/application_settings/_form.html.haml +++ b/app/views/admin/application_settings/_form.html.haml @@ -124,14 +124,5 @@ = f.text_area :help_page_text, class: 'form-control', rows: 4 .help-block Markdown enabled - %fieldset - %legend Continuous Integration - .form-group - .col-sm-offset-2.col-sm-10 - .checkbox - = f.label :ci_enabled do - = f.check_box :ci_enabled - Disable to prevent CI usage until rake ci:migrate is run (8.0 only) - .form-actions = f.submit 'Save', class: 'btn btn-primary' diff --git a/app/views/ci/projects/disabled.html.haml b/app/views/ci/projects/disabled.html.haml deleted file mode 100644 index 83b0d8329e1..00000000000 --- a/app/views/ci/projects/disabled.html.haml +++ /dev/null @@ -1 +0,0 @@ -Continuous Integration has been disabled for time of the migration. diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 4e4a8ecbdb3..4c78bd6e2fa 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -178,7 +178,6 @@ Settings.gitlab['import_sources'] ||= ['github','bitbucket','gitlab','gitorious' # CI # Settings['gitlab_ci'] ||= Settingslogic.new({}) -Settings.gitlab_ci['enabled'] = true if Settings.gitlab_ci['enabled'].nil? Settings.gitlab_ci['all_broken_builds'] = true if Settings.gitlab_ci['all_broken_builds'].nil? Settings.gitlab_ci['add_pusher'] = false if Settings.gitlab_ci['add_pusher'].nil? Settings.gitlab_ci['url'] ||= Settings.send(:build_gitlab_ci_url) diff --git a/db/migrate/20151005162154_remove_ci_enabled_from_application_settings.rb b/db/migrate/20151005162154_remove_ci_enabled_from_application_settings.rb new file mode 100644 index 00000000000..be6aa810bb5 --- /dev/null +++ b/db/migrate/20151005162154_remove_ci_enabled_from_application_settings.rb @@ -0,0 +1,5 @@ +class RemoveCiEnabledFromApplicationSettings < ActiveRecord::Migration + def change + remove_column :application_settings, :ci_enabled, :boolean, null: false, default: true + end +end diff --git a/db/schema.rb b/db/schema.rb index 0e8d54fb267..95e450d6fe0 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20151005075649) do +ActiveRecord::Schema.define(version: 20151005162154) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -46,7 +46,6 @@ ActiveRecord::Schema.define(version: 20151005075649) do t.integer "session_expire_delay", default: 10080, null: false t.text "import_sources" t.text "help_page_text" - t.boolean "ci_enabled", default: true, null: false end create_table "audit_events", force: true do |t| diff --git a/lib/ci/api/api.rb b/lib/ci/api/api.rb index 5109c84e0ea..218d8c3adcc 100644 --- a/lib/ci/api/api.rb +++ b/lib/ci/api/api.rb @@ -23,10 +23,6 @@ module Ci rack_response({ 'message' => '500 Internal Server Error' }, 500) end - before do - check_enable_flag! - end - format :json helpers Helpers diff --git a/lib/ci/api/helpers.rb b/lib/ci/api/helpers.rb index 8e893aa5cc6..e602cda81d6 100644 --- a/lib/ci/api/helpers.rb +++ b/lib/ci/api/helpers.rb @@ -3,12 +3,6 @@ module Ci module Helpers UPDATE_RUNNER_EVERY = 60 - def check_enable_flag! - unless current_application_settings.ci_enabled - render_api_error!('400 (Bad request) CI is disabled', 400) - end - end - def authenticate_runners! forbidden! unless params[:token] == GitlabCi::REGISTRATION_TOKEN end |