......@@ -46,6 +46,7 @@ rules:
vue/no-v-html: off
vue/use-v-on-exact: off
no-jquery/no-animate: off
# all offenses of no-jquery/no-animate-toggle are false positives ( $toast.show() )
no-jquery/no-animate-toggle: off
no-jquery/no-fade: off
no-jquery/no-serialize: error
......
......
......@@ -930,7 +930,7 @@ GEM
rubyntlm (0.6.2)
rubypants (0.2.0)
rubyzip (1.3.0)
rugged (0.28.3.1)
rugged (0.28.4.1)
safe_yaml (1.0.4)
sanitize (4.6.6)
crass (~> 1.0.2)
......
......
......@@ -163,7 +163,7 @@ module Git
end
def logger
if Gitlab::Runtime.sidekiq?
if Sidekiq.server?
Sidekiq.logger
else
# This service runs in Sidekiq, so this shouldn't ever be
......
......
---
title: Authenticate requests with job token as basic auth header for request limiting
merge_request: 21562
author:
type: fixed
---
title: Add timestamps to pod logs
merge_request: 21663
author:
type: added
---
title: Update Rugged to v0.28.4.1
merge_request: 21869
author:
type: security
......@@ -22,7 +22,6 @@ module Gitlab
require_dependency Rails.root.join('lib/gitlab/current_settings')
require_dependency Rails.root.join('lib/gitlab/middleware/read_only')
require_dependency Rails.root.join('lib/gitlab/middleware/basic_health_check')
require_dependency Rails.root.join('lib/gitlab/runtime')
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
......@@ -256,7 +255,7 @@ module Gitlab
caching_config_hash[:compress] = false
caching_config_hash[:namespace] = Gitlab::Redis::Cache::CACHE_NAMESPACE
caching_config_hash[:expires_in] = 2.weeks # Cache should not grow forever
if Gitlab::Runtime.multi_threaded?
if Sidekiq.server? || defined?(::Puma) # threaded context
caching_config_hash[:pool_size] = Gitlab::Redis::Cache.pool_size
caching_config_hash[:pool_timeout] = 1
end
......
......
......@@ -46,7 +46,7 @@ Rails.application.configure do
# Do not log asset requests
config.assets.quiet = true
config.allow_concurrency = Gitlab::Runtime.multi_threaded?
config.allow_concurrency = defined?(::Puma)
# BetterErrors live shell (REPL) on every stack frame
BetterErrors::Middleware.allow_ip!("127.0.0.1/0")
......
......
......@@ -75,5 +75,5 @@ Rails.application.configure do
config.eager_load = true
config.allow_concurrency = Gitlab::Runtime.multi_threaded?
config.allow_concurrency = defined?(::Puma)
end
# frozen_string_literal: true
begin
Gitlab::AppLogger.info("Runtime: #{Gitlab::Runtime.name}")
rescue => e
message = <<-NOTICE
\n!! RUNTIME IDENTIFICATION FAILED: #{e}
Runtime based configuration settings may not work properly.
If you continue to see this error, please file an issue via
https://gitlab.com/gitlab-org/gitlab/issues/new
NOTICE
Gitlab::AppLogger.error(message)
end
......@@ -364,7 +364,7 @@ Gitlab.ee do
# To ensure acceptable performance we only allow feature to be used with
# multithreaded web-server Puma. This will be removed once download logic is moved
# to GitLab workhorse
Settings.dependency_proxy['enabled'] = false unless Gitlab::Runtime.puma?
Settings.dependency_proxy['enabled'] = false unless defined?(::Puma)
end
#
......
......
......@@ -4,11 +4,11 @@ require 'prometheus/client'
def prometheus_default_multiproc_dir
return unless Rails.env.development? || Rails.env.test?
if Gitlab::Runtime.sidekiq?
if Sidekiq.server?
Rails.root.join('tmp/prometheus_multiproc_dir/sidekiq')
elsif Gitlab::Runtime.unicorn?
elsif defined?(Unicorn::Worker)
Rails.root.join('tmp/prometheus_multiproc_dir/unicorn')
elsif Gitlab::Runtime.puma?
elsif defined?(::Puma)
Rails.root.join('tmp/prometheus_multiproc_dir/puma')
else
Rails.root.join('tmp/prometheus_multiproc_dir')
......@@ -48,9 +48,9 @@ if !Rails.env.test? && Gitlab::Metrics.prometheus_metrics_enabled?
Gitlab::Cluster::LifecycleEvents.on_master_start do
::Prometheus::Client.reinitialize_on_pid_change(force: true)
if Gitlab::Runtime.unicorn?
if defined?(::Unicorn)
Gitlab::Metrics::Samplers::UnicornSampler.instance(Settings.monitoring.unicorn_sampler_interval).start
elsif Gitlab::Runtime.puma?
elsif defined?(::Puma)
Gitlab::Metrics::Samplers::PumaSampler.instance(Settings.monitoring.puma_sampler_interval).start
end
......@@ -58,7 +58,7 @@ if !Rails.env.test? && Gitlab::Metrics.prometheus_metrics_enabled?
end
end
if Gitlab::Runtime.app_server?
if defined?(::Unicorn) || defined?(::Puma)
Gitlab::Cluster::LifecycleEvents.on_master_start do
Gitlab::Metrics::Exporter::WebExporter.instance.start
end
......
......
......@@ -2,7 +2,7 @@
# Don't handle sidekiq configuration as it
# has its own special active record configuration here
if defined?(ActiveRecord::Base) && !Gitlab::Runtime.sidekiq?
if defined?(ActiveRecord::Base) && !Sidekiq.server?
Gitlab::Cluster::LifecycleEvents.on_worker_start do
ActiveSupport.on_load(:active_record) do
ActiveRecord::Base.establish_connection
......
......
......@@ -5,8 +5,10 @@
#
# Follow-up the issue: https://gitlab.com/gitlab-org/gitlab/issues/34107
if Gitlab::Runtime.puma?
if defined?(::Puma)
Puma::Cluster.prepend(::Gitlab::Cluster::Mixins::PumaCluster)
elsif Gitlab::Runtime.unicorn?
end
if defined?(::Unicorn::HttpServer)
Unicorn::HttpServer.prepend(::Gitlab::Cluster::Mixins::UnicornHttpServer)
end
......@@ -2,7 +2,7 @@
# when running on puma, scale connection pool size with the number
# of threads per worker process
if Gitlab::Runtime.puma?
if defined?(::Puma)
db_config = Gitlab::Database.config ||
Rails.application.config.database_configuration[Rails.env]
puma_options = Puma.cli_config.options
......
......
# Only use Lograge for Rails
unless Gitlab::Runtime.sidekiq?
unless Sidekiq.server?
filename = File.join(Rails.root, 'log', "#{Rails.env}_json.log")
Rails.application.configure do
......
......
......@@ -9,7 +9,7 @@
# and it's used only as the last resort. In such case this termination is
# logged and we should fix the potential timeout issue in the code itself.
if Gitlab::Runtime.puma? && !Rails.env.test?
if defined?(::Puma) && !Rails.env.test?
require 'rack/timeout/base'
Gitlab::Application.configure do |config|
......
......
......@@ -13,7 +13,7 @@ if Labkit::Tracing.enabled?
end
# Instrument Sidekiq server calls when running Sidekiq server
if Gitlab::Runtime.sidekiq?
if Sidekiq.server?
Sidekiq.configure_server do |config|
config.server_middleware do |chain|
chain.add Labkit::Tracing::Sidekiq::ServerMiddleware
......
......
# frozen_string_literal: true
if Gitlab::Runtime.puma? && ::Puma.cli_config.options[:workers].to_i.zero?
if defined?(::Puma) && ::Puma.cli_config.options[:workers].to_i.zero?
raise 'Puma is only supported in Cluster-mode: workers > 0'
end
......@@ -100,8 +100,8 @@ module Gitlab
end
def self.process_name
return 'sidekiq' if Gitlab::Runtime.sidekiq?
return 'console' if Gitlab::Runtime.console?
return 'sidekiq' if Sidekiq.server?
return 'console' if defined?(Rails::Console)
return 'test' if Rails.env.test?
'web'
......
......