diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-02-28 22:46:53 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-02-28 22:46:53 +0300 |
commit | 45d2c31643017807cb3fc66c0be6e9cad9964faf (patch) | |
tree | b3564188de7323969c6ba0a7ec4c86a3b6cce2ac /config | |
parent | 87f11d2cf539d9539b439b54355f0dadaf4ebf76 (diff) | |
parent | 4b92efd90cedaa0aff218d11fdce279701128bea (diff) |
Merge commit '4b92efd90cedaa0aff218d11fdce279701128bea' into object-storage-ee-to-ce-backport
Diffstat (limited to 'config')
-rw-r--r-- | config/application.rb | 6 | ||||
-rw-r--r-- | config/gitlab.yml.example | 1 | ||||
-rw-r--r-- | config/initializers/active_record_data_types.rb | 5 | ||||
-rw-r--r-- | config/initializers/active_record_schema_ignore_tables.rb | 2 | ||||
-rw-r--r-- | config/initializers/asset_sync.rb | 31 | ||||
-rw-r--r-- | config/initializers/fix_local_cache_middleware.rb | 2 | ||||
-rw-r--r-- | config/initializers/flipper.rb | 24 | ||||
-rw-r--r-- | config/initializers/forbid_sidekiq_in_transactions.rb | 8 | ||||
-rw-r--r-- | config/initializers/peek.rb | 2 | ||||
-rw-r--r-- | config/initializers/rspec_profiling.rb | 4 | ||||
-rw-r--r-- | config/initializers/rugged_use_gitlab_git_attributes.rb | 5 | ||||
-rw-r--r-- | config/initializers/sidekiq.rb | 18 | ||||
-rw-r--r-- | config/no_todos_messages.yml | 6 | ||||
-rw-r--r-- | config/routes.rb | 2 | ||||
-rw-r--r-- | config/routes/project.rb | 10 | ||||
-rw-r--r-- | config/sidekiq_queues.yml | 5 | ||||
-rw-r--r-- | config/webpack.config.js | 24 |
17 files changed, 110 insertions, 45 deletions
diff --git a/config/application.rb b/config/application.rb index 6436f887d14..1110199b888 100644 --- a/config/application.rb +++ b/config/application.rb @@ -34,6 +34,10 @@ module Gitlab config.generators.templates.push("#{config.root}/generator_templates") + # Rake tasks ignore the eager loading settings, so we need to set the + # autoload paths explicitly + config.autoload_paths = config.eager_load_paths.dup + # Only load the plugins named here, in the order given (default is alphabetical). # :all can be used as a placeholder for all plugins not explicitly named. # config.plugins = [ :exception_notification, :ssl_requirement, :all ] @@ -159,7 +163,7 @@ module Gitlab config.middleware.insert_after ActionDispatch::Flash, 'Gitlab::Middleware::ReadOnly' config.generators do |g| - g.factory_girl false + g.factory_bot false end config.after_initialize do diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index d8fa3138184..cab72032d22 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -405,6 +405,7 @@ production: &base # Sync user's profile from the specified Omniauth providers every time the user logs in (default: empty). # Define the allowed providers using an array, e.g. ["cas3", "saml", "twitter"], # or as true/false to allow all providers or none. + # When authenticating using LDAP, the user's email is always synced. # sync_profile_from_provider: [] # Select which info to sync from the providers above. (default: email). diff --git a/config/initializers/active_record_data_types.rb b/config/initializers/active_record_data_types.rb index fef591c397d..0359e14b232 100644 --- a/config/initializers/active_record_data_types.rb +++ b/config/initializers/active_record_data_types.rb @@ -79,3 +79,8 @@ elsif Gitlab::Database.mysql? NATIVE_DATABASE_TYPES[:datetime_with_timezone] = { name: 'timestamp' } end end + +# Ensure `datetime_with_timezone` columns are correctly written to schema.rb +if (ActiveRecord::Base.connection.active? rescue false) + ActiveRecord::Base.connection.send :reload_type_map +end diff --git a/config/initializers/active_record_schema_ignore_tables.rb b/config/initializers/active_record_schema_ignore_tables.rb new file mode 100644 index 00000000000..661135f8ade --- /dev/null +++ b/config/initializers/active_record_schema_ignore_tables.rb @@ -0,0 +1,2 @@ +# Ignore table used temporarily in background migration +ActiveRecord::SchemaDumper.ignore_tables = ["untracked_files_for_uploads"] diff --git a/config/initializers/asset_sync.rb b/config/initializers/asset_sync.rb new file mode 100644 index 00000000000..7f3934853fa --- /dev/null +++ b/config/initializers/asset_sync.rb @@ -0,0 +1,31 @@ +AssetSync.configure do |config| + # Disable the asset_sync gem by default. If it is enabled, but not configured, + # asset_sync will cause the build to fail. + config.enabled = if ENV.has_key?('ASSET_SYNC_ENABLED') + ENV['ASSET_SYNC_ENABLED'] == 'true' + else + false + end + + # Pulled from https://github.com/AssetSync/asset_sync/blob/v2.2.0/lib/asset_sync/engine.rb#L15-L40 + # This allows us to disable asset_sync by default and configure through environment variables + # Updates to asset_sync gem should be checked + config.fog_provider = ENV['FOG_PROVIDER'] if ENV.has_key?('FOG_PROVIDER') + config.fog_directory = ENV['FOG_DIRECTORY'] if ENV.has_key?('FOG_DIRECTORY') + config.fog_region = ENV['FOG_REGION'] if ENV.has_key?('FOG_REGION') + + config.aws_access_key_id = ENV['ASSETS_AWS_ACCESS_KEY_ID'] if ENV.has_key?('ASSETS_AWS_ACCESS_KEY_ID') + config.aws_secret_access_key = ENV['ASSETS_AWS_SECRET_ACCESS_KEY'] if ENV.has_key?('ASSETS_AWS_SECRET_ACCESS_KEY') + config.aws_reduced_redundancy = ENV['AWS_REDUCED_REDUNDANCY'] == true if ENV.has_key?('AWS_REDUCED_REDUNDANCY') + + config.rackspace_username = ENV['RACKSPACE_USERNAME'] if ENV.has_key?('RACKSPACE_USERNAME') + config.rackspace_api_key = ENV['RACKSPACE_API_KEY'] if ENV.has_key?('RACKSPACE_API_KEY') + + config.google_storage_access_key_id = ENV['GOOGLE_STORAGE_ACCESS_KEY_ID'] if ENV.has_key?('GOOGLE_STORAGE_ACCESS_KEY_ID') + config.google_storage_secret_access_key = ENV['GOOGLE_STORAGE_SECRET_ACCESS_KEY'] if ENV.has_key?('GOOGLE_STORAGE_SECRET_ACCESS_KEY') + + config.existing_remote_files = ENV['ASSET_SYNC_EXISTING_REMOTE_FILES'] || "keep" + + config.gzip_compression = (ENV['ASSET_SYNC_GZIP_COMPRESSION'] == 'true') if ENV.has_key?('ASSET_SYNC_GZIP_COMPRESSION') + config.manifest = (ENV['ASSET_SYNC_MANIFEST'] == 'true') if ENV.has_key?('ASSET_SYNC_MANIFEST') +end diff --git a/config/initializers/fix_local_cache_middleware.rb b/config/initializers/fix_local_cache_middleware.rb index cb37f9ed22c..2644ee6a7d3 100644 --- a/config/initializers/fix_local_cache_middleware.rb +++ b/config/initializers/fix_local_cache_middleware.rb @@ -6,7 +6,7 @@ module LocalCacheRegistryCleanupWithEnsure def call(env) LocalCacheRegistry.set_cache_for(local_cache_key, LocalStore.new) - response = @app.call(env) + response = @app.call(env) # rubocop:disable Gitlab/ModuleWithInstanceVariables response[2] = ::Rack::BodyProxy.new(response[2]) do LocalCacheRegistry.set_cache_for(local_cache_key, nil) end diff --git a/config/initializers/flipper.rb b/config/initializers/flipper.rb index bfab8c77a4b..cc9167d29b9 100644 --- a/config/initializers/flipper.rb +++ b/config/initializers/flipper.rb @@ -1,8 +1,22 @@ -require 'flipper/middleware/memoizer' +require 'flipper/adapters/active_record' +require 'flipper/adapters/active_support_cache_store' -unless Rails.env.test? - Rails.application.config.middleware.use Flipper::Middleware::Memoizer, - lambda { Feature.flipper } +Flipper.configure do |config| + config.default do + adapter = Flipper::Adapters::ActiveRecord.new( + feature_class: Feature::FlipperFeature, gate_class: Feature::FlipperGate) + cached_adapter = Flipper::Adapters::ActiveSupportCacheStore.new( + adapter, + Rails.cache, + expires_in: 10.seconds) + + Flipper.new(cached_adapter) + end +end - Feature.register_feature_groups +Feature.register_feature_groups + +unless Rails.env.test? + require 'flipper/middleware/memoizer' + Rails.application.config.middleware.use Flipper::Middleware::Memoizer end diff --git a/config/initializers/forbid_sidekiq_in_transactions.rb b/config/initializers/forbid_sidekiq_in_transactions.rb index bedd57ede04..cb611aa21df 100644 --- a/config/initializers/forbid_sidekiq_in_transactions.rb +++ b/config/initializers/forbid_sidekiq_in_transactions.rb @@ -1,5 +1,7 @@ module Sidekiq module Worker + EnqueueFromTransactionError = Class.new(StandardError) + mattr_accessor :skip_transaction_check self.skip_transaction_check = false @@ -12,11 +14,11 @@ module Sidekiq end module ClassMethods - module NoSchedulingFromTransactions + module NoEnqueueingFromTransactions %i(perform_async perform_at perform_in).each do |name| define_method(name) do |*args| if !Sidekiq::Worker.skip_transaction_check && AfterCommitQueue.inside_transaction? - raise <<-MSG.strip_heredoc + raise Sidekiq::Worker::EnqueueFromTransactionError, <<~MSG `#{self}.#{name}` cannot be called inside a transaction as this can lead to race conditions when the worker runs before the transaction is committed and tries to access a model that has not been saved yet. @@ -30,7 +32,7 @@ module Sidekiq end end - prepend NoSchedulingFromTransactions + prepend NoEnqueueingFromTransactions end end end diff --git a/config/initializers/peek.rb b/config/initializers/peek.rb index 1cff355346c..581397b26f8 100644 --- a/config/initializers/peek.rb +++ b/config/initializers/peek.rb @@ -18,7 +18,7 @@ Peek.into Peek::Views::Rblineprof Peek.into Peek::Views::GC Peek.into Peek::Views::Gitaly -# rubocop:disable Style/ClassAndModuleCamelCase +# rubocop:disable Naming/ClassAndModuleCamelCase class PEEK_DB_CLIENT class << self attr_accessor :query_details diff --git a/config/initializers/rspec_profiling.rb b/config/initializers/rspec_profiling.rb index 16b9d5b15e5..2de310753a9 100644 --- a/config/initializers/rspec_profiling.rb +++ b/config/initializers/rspec_profiling.rb @@ -19,10 +19,10 @@ module RspecProfilingExt def example_finished(*args) super rescue => err - return if @already_logged_example_finished_error + return if @already_logged_example_finished_error # rubocop:disable Gitlab/ModuleWithInstanceVariables $stderr.puts "rspec_profiling couldn't collect an example: #{err}. Further warnings suppressed." - @already_logged_example_finished_error = true + @already_logged_example_finished_error = true # rubocop:disable Gitlab/ModuleWithInstanceVariables end alias_method :example_passed, :example_finished diff --git a/config/initializers/rugged_use_gitlab_git_attributes.rb b/config/initializers/rugged_use_gitlab_git_attributes.rb index 7d652799786..1cfb3bcb4bd 100644 --- a/config/initializers/rugged_use_gitlab_git_attributes.rb +++ b/config/initializers/rugged_use_gitlab_git_attributes.rb @@ -15,8 +15,11 @@ module Rugged class Repository module UseGitlabGitAttributes def fetch_attributes(name, *) + attributes.attributes(name) + end + + def attributes @attributes ||= Gitlab::Git::Attributes.new(path) - @attributes.attributes(name) end end diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index ba4481ae602..0f164e628f9 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -42,6 +42,8 @@ Sidekiq.configure_server do |config| Gitlab::SidekiqThrottler.execute! + Gitlab::SidekiqVersioning.install! + config = Gitlab::Database.config || Rails.application.config.database_configuration[Rails.env] config['pool'] = Sidekiq.options[:concurrency] @@ -60,19 +62,3 @@ Sidekiq.configure_client do |config| chain.add Gitlab::SidekiqStatus::ClientMiddleware end end - -# The Sidekiq client API always adds the queue to the Sidekiq queue -# list, but mail_room and gitlab-shell do not. This is only necessary -# for monitoring. -begin - queues = Gitlab::SidekiqConfig.worker_queues - - Sidekiq.redis do |conn| - conn.pipelined do - queues.each do |queue| - conn.sadd('queues', queue) - end - end - end -rescue Redis::BaseError, SocketError, Errno::ENOENT, Errno::EADDRNOTAVAIL, Errno::EAFNOSUPPORT, Errno::ECONNRESET, Errno::ECONNREFUSED -end diff --git a/config/no_todos_messages.yml b/config/no_todos_messages.yml index 264a975b614..da721a9b6e6 100644 --- a/config/no_todos_messages.yml +++ b/config/no_todos_messages.yml @@ -3,9 +3,9 @@ # # If you come up with a fun one, please feel free to contribute it to GitLab! # https://about.gitlab.com/contributing/ ---- -- Good job! Looks like you don't have any todos left. +--- +- Good job! Looks like you don't have any todos left - Isn't an empty todo list beautiful? - Give yourself a pat on the back! - Nothing left to do, high five! -- Henceforth you shall be known as "Todo Destroyer". +- Henceforth you shall be known as "Todo Destroyer" diff --git a/config/routes.rb b/config/routes.rb index 016140e0ede..f162043dd5e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -43,6 +43,8 @@ Rails.application.routes.draw do get 'liveness' => 'health#liveness' get 'readiness' => 'health#readiness' post 'storage_check' => 'health#storage_check' + get 'ide' => 'ide#index' + get 'ide/*vueroute' => 'ide#index', format: false resources :metrics, only: [:index] mount Peek::Railtie => '/peek' diff --git a/config/routes/project.rb b/config/routes/project.rb index 093da10f57f..bdf4b199c0a 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -96,6 +96,7 @@ constraints(ProjectUrlConstrainer.new) do post :toggle_subscription post :remove_wip post :assign_related_issues + post :rebase scope constraints: { format: nil }, action: :show do get :commits, defaults: { tab: 'commits' } @@ -179,6 +180,7 @@ constraints(ProjectUrlConstrainer.new) do resources :pipeline_schedules, except: [:show] do member do + post :play post :take_ownership end end @@ -382,8 +384,8 @@ constraints(ProjectUrlConstrainer.new) do resources :runners, only: [:index, :edit, :update, :destroy, :show] do member do - get :resume - get :pause + post :resume + post :pause end collection do @@ -406,7 +408,9 @@ constraints(ProjectUrlConstrainer.new) do end namespace :settings do get :members, to: redirect("%{namespace_id}/%{project_id}/project_members") - resource :ci_cd, only: [:show], controller: 'ci_cd' + resource :ci_cd, only: [:show], controller: 'ci_cd' do + post :reset_cache + end resource :integrations, only: [:show] resource :repository, only: [:show], controller: :repository end diff --git a/config/sidekiq_queues.yml b/config/sidekiq_queues.yml index e059d7c11e0..eb49869e031 100644 --- a/config/sidekiq_queues.yml +++ b/config/sidekiq_queues.yml @@ -25,8 +25,6 @@ - [new_note, 2] - [new_issue, 2] - [new_merge_request, 2] - - [build, 2] - - [pipeline, 2] - [pipeline_processing, 5] - [pipeline_creation, 4] - [pipeline_default, 3] @@ -38,11 +36,12 @@ - [mailers, 2] - [invalid_gpg_signature_update, 2] - [create_gpg_signature, 2] + - [rebase, 2] - [upload_checksum, 1] - [repository_fork, 1] - [repository_import, 1] - [github_importer, 1] - - [github_importer_advance_stage, 1] + - [github_import_advance_stage, 1] - [project_service, 1] - [delete_user, 1] - [delete_merged_branches, 1] diff --git a/config/webpack.config.js b/config/webpack.config.js index 78ced4c3e8c..5f95255334c 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -32,10 +32,10 @@ var config = { boards: './boards/boards_bundle.js', common: './commons/index.js', common_vue: './vue_shared/vue_resource_interceptor.js', - common_d3: ['d3'], cycle_analytics: './cycle_analytics/cycle_analytics_bundle.js', commit_pipelines: './commit/pipelines/pipelines_bundle.js', deploy_keys: './deploy_keys/index.js', + docs: './docs/docs_bundle.js', diff_notes: './diff_notes/diff_notes_bundle.js', environments: './environments/environments_bundle.js', environments_folder: './environments/folder/environments_folder_bundle.js', @@ -70,7 +70,7 @@ var config = { protected_branches: './protected_branches', protected_tags: './protected_tags', registry_list: './registry/index.js', - repo: './repo/index.js', + ide: './ide/index.js', sidebar: './sidebar/sidebar_bundle.js', schedule_form: './pipeline_schedules/pipeline_schedule_form_bundle.js', schedules_index: './pipeline_schedules/pipeline_schedules_index_bundle.js', @@ -118,7 +118,10 @@ var config = { }, { test: /\_worker\.js$/, - loader: 'worker-loader', + use: [ + { loader: 'worker-loader' }, + { loader: 'babel-loader' }, + ], }, { test: /\.(worker(\.min)?\.js|pdf|bmpr)$/, @@ -138,6 +141,7 @@ var config = { ], noParse: [/monaco-editor\/\w+\/vs\//], + strictExportPresence: true, }, plugins: [ @@ -176,8 +180,13 @@ var config = { return chunk.name; } return chunk.mapModules((m) => { - var chunkPath = m.request.split('!').pop(); - return path.relative(m.context, chunkPath); + const pagesBase = path.join(ROOT_PATH, 'app/assets/javascripts/pages'); + if (m.resource.indexOf(pagesBase) === 0) { + return path.relative(pagesBase, m.resource) + .replace(/\/index\.[a-z]+$/, '') + .replace(/\//g, '__'); + } + return path.relative(m.context, m.resource); }).join('_'); }), @@ -204,7 +213,7 @@ var config = { 'pipelines', 'pipelines_details', 'registry_list', - 'repo', + 'ide', 'schedule_form', 'schedules_index', 'sidebar', @@ -224,6 +233,9 @@ var config = { 'monitoring', 'users', ], + minChunks: function (module, count) { + return module.resource && /d3-/.test(module.resource); + }, }), // create cacheable common library bundles |